we get four values of $x:$
$$x=\frac{\pm \sqrt{3}}{2}, \frac{\pm \sqrt{10+2 \sqrt{5}}}{4} \tag7$$
out of which only $$x=\frac{-\sqrt{3}}{2}, \frac{-\sqrt{10+2 \sqrt{5}}}{4}$$ will satisfy.
Actually, among these four solutions, only $x=\frac{\sqrt{3}}{2}$ is extraneous; it was introduced, together with the other extraneous solution $x=0,$ in step $(3)$. Every other step—including the two squaring steps—turns out to be “reversible” (preserve the solution set), even as you have not justified how (for example, by specifying a relevant implicit constraint).
$$\frac{1+\sqrt{1-x}}{x-\sqrt{1-x^{2}}}=2 x$$
$$1+\sqrt{1-x}=2x^2-2x\sqrt{1-x^2} \tag1$$
Squaring the above equation, we get
$$2(1+\sqrt{1-x})-x=4x^4+4x^2(1-x^2)-8x^3\sqrt{1-x^2} \tag2$$
From $(1),$ we get $$2(2x^2-2x\sqrt{1-x^2})-x=4x^2-8x^3\sqrt{1-x^2}\tag3$$
Substituting equation $(1)$ into equation $(2)$ to create equation $(3)$ has expanded the candidate solution set, as $(1)$ is a conditional equation rather than an identity (like $(x+3)^2=x^2+6x+9,$ which is universally true).
Since equation $(1)$ holds at our required solution points, they will not be discarded. However, at every other point, equation $(1)$ is false, so deductive explosion will occur, so a spurious conclusion (extraneous solution) may ensue even as our subsequent argument remains valid.
Here's a silly clearer example to illustrate. We want to solve the equation $$x^2+1=5.\tag i$$ Thus, $$x^2=4.\tag {ii}$$ Substituting $(\mathrm{ii})$ into $(\mathrm i):$ $$5=5\\x+5=x+5\\x=x.$$ Therefore, every number is a potential/candidate solution of equation $(\mathrm i).$
To be clear, neither of the above substitution steps is invalid: they do not discard actual solutions, and merely turn out to have created extraneous solutions which then need to be sifted out.