I come across this example from this answer. Could you check if my understanding is correct?
Let $X := (0, 1) \cup \{2\} \subseteq \mathbb R$. We endow $X$ with the usual norm $| \cdot |$. Because $\{2\} = \mathbb B_X(2, 1/2) = \overline{\mathbb B}_X(2, 1/2)$, so $\{2\}$ is clopen in $X$. It follows that $(0,1) = X \setminus \{2\}$ is also clopen in $X$. We can also obtain the closeness of $\{2\}$ by the fact that in metric space, a singleton is closed.