You wrote it wrong in the question, but that's not why you get two answers. First I'll show the solving steps:
\begin{align}
x&=12+(2+(2+x^{-1})^{-1})^{-1}\\
x-12&=(2+(2+x^{-1})^{-1})^{-1}\\
(x-12)(2+(2+x^{-1})^{-1})&=1\\
x(2+x^{-1})^{-1}-12(2+x^{-1})^{-1}&=25-2x\\
x-12&=(25-2x)(2+x^{-1})\\
x^2-12x&=(25-2x)(2x+1)\\
5x^2-60x-25&=0\\
x^2-12x-5&=0\\
(x-6)^2&=41\\
x&=6\pm\sqrt{41}
\end{align}
Now as you understandably ask, why are there two solutions?

The simple answer is that both numbers satisfy the equation we set up, that is, when we turned the infinite fraction into an equation, we introduced an extra solution. This is because the equation and the infinite fraction are not equivalent statements, one implies the other but not the other way around.

Remember to always check whether your solutions are actually solutions when you solve an equation, this time you see one solution is wrong since it's obviously at least 12.

This same problem can also happen in other equations, let's say you solve the following equation:
\begin{align}
\frac{x^2}{x+1} &= \frac1{x+1}\\
x^2 &= 1\\
x &= \pm1\\
\end{align}
We find the solutions $1$ and $-1$, but notice how only $1$ is actually an solution, with $-1$ you get division by zero. This is a similar problem with the same answer, check your solutions after finding them.