Is the following proposition true for real numbers?
$$\frac{\sqrt{2|x|-x^2}-0}{x}=\begin{cases}\sqrt{\frac{2}{x}-1}&,\;\;\;x>0\\{}\\\sqrt{-\frac{2}{x}-1}&,\;\;\;x<0\end{cases}$$
I claim not, since if $x=-1$ the left hand side is $-1$, but the right hand side is $1$.
When you do the step $$\frac{\sqrt{\cdots}}x=\sqrt{\frac{\cdots}{x^2}}$$
You are losing the sign on the $x$. This means that if $x$ was negative or positive the result is the same, which is wrong.
Your counterexample is fine, and julien's remark is exactly the meaning of the point I am trying to make.
Remember that $x=\sqrt{x^2}$ if and only if $x$ is positive, that is $\sqrt{x^2}=|x|$ rather than just $x$. And for negative numbers this could be a problem.