Throughout this answer, let $X=\mathbb{R}^n$ for simplicity. Note that we can replace $X$ (I think) with any simply connected, locally connected metric space.
Lemma 1. If $A\subseteq X$ is closed, then $$\partial A = \bigcup_i\partial \Gamma_i$$
where $\{\Gamma_i\}_i$ are the connected components of $A$.
Proof. Suppose $x\in \partial A$, and let $\Gamma$ be the connected component of $A$ containing $x$. Then $A$ does not contain a neighborhood (in $X$) of $x$, so neither does $\Gamma\subseteq A$. Thus, $x\in \partial \Gamma$.
Now suppose instead that $x\in \partial \Gamma$, where $\Gamma$ is a connected component of $A$. Then $\Gamma$ does not contain a neighborhood (in $X$) of $x$. If $A$ contains a neighborhood (in $X$) of $x$, then it contains a connected neighboorhood $N$ of $x$, since $X$ is locally connected. However, then $N\subseteq \Gamma$, which is a contradiction, so $x\in \partial A$.
Theorem 1. If $A$ is open, connected, and non-empty, then $\partial A$ is connected iff $X-A$ is connected.
Proof. See this post. Note that the top answer does not make use of OPs extra assumptions. Even boundedness is not necessary to conclude $k(x)$ is continuous because $d(x,U)+d(x,V) = 0$ implies that $x\in \overline{U}\cap \overline{V} = U\cap V$, which contradicts the definition of $U$ and $V$.
Theorem 2. If $A,B\subseteq X$ are open, connected, disjoint, and non-empty, and $\partial A = \partial B$, then $\partial A$ is connected.
Proof. Since $B$ is connected, so is $\overline{B}$. Let $\{\Gamma_i\}_i$ be the connected components of $X-A$, and let $\Gamma_j$ be the connected component of $X-A$ containing $\overline{B}$. Then, $\partial\Gamma_j\subseteq\partial A = \partial B\subseteq \Gamma_j$ by lemma 1. Since the $\Gamma_i$ are disjoint, $\partial\Gamma_i = \emptyset$ for $i\neq j$, and thus $\partial \Gamma_j=\partial A$ by lemma 1 as well. However, $\partial \Gamma_i$ can only be empty if $\Gamma_i$ is clopen in $X$ (i.e. $\Gamma_i \in \{X,\emptyset\}$), which is not possible as $A$ and $\Gamma_i$ are non-empty by definition. Thus, $X-A=\Gamma_j$ is connected, so $\partial A$ is connected by theorem 1.