Analysis of a seemingly-complicated algebraic identity This is a self-answered question. I post it here since it wasn't trivial for me.
Consider the equality
$$
 2\frac{x^4-4 x^3+2 x^2 (y^2+2)-4 x y^2+y^2 (y^2+8)}{(x^2-2 x+y^2)^2}=2+\frac{4y^2}{(1-x)^2}, \tag{1}
$$
where $x,y$ are real numbers.
Mathematica claims that if this equality holds, then if $y \neq 0$, then
$$
x\in \{\pm\sqrt{2-y^2},  2 \pm \sqrt{2-y^2}\}. 
$$
Is there any chance we could verify this "by hand"?
(If $y=0$, then the equality holds for any $x \neq 2$.)

The motivation for considering this equality comes from this problem.

Multiplying equation $(1)$ by $(x^2-2 x+y^2)^2$, we obtain
$$
2x^4-8 x^3+4x^2y^2+8x^2-8xy^2+2y^2(y^2+8)=
$$
$$2x^4+8x^2+2y^4-8x^3-8xy^2+4x^2y^2+\frac{4y^2(x^2-2 x+y^2)^2}{(1-x)^2},
$$
which after cancellations becomes
$$
16y^2=\frac{4y^2(x^2-2 x+y^2)^2}{(1-x)^2}.
$$
Thus, if $y \neq 0$, we can divide by $4y^2$, and get
$$
4=\big(\frac{x^2-2 x+y^2}{1-x}\big)^2,
$$
so
$$
x^2-2 x+y^2=\pm 2(1-x).
$$
If $x^2-2 x+y^2=2(1-x)$, then $x^2+y^2=2 \Rightarrow x=\pm \sqrt{2-y^2}$.
If $x^2-2 x+y^2=2(x-1)$, then solving the quadratic for $x$ one get $x=2 \pm \sqrt{2-y^2}$.
