Suppose, I have two points $A(x, 6)$ and $B(5,6)$ and $AB = 4$ unit. We have to find the value of $x$.
Process 1:
$$AB=\sqrt{(x-5)^2+0}$$
[Only positive root is taken as length is positive]
$$\implies 4=\sqrt{(x-5)^2}$$
$$\implies 4=x-5$$
$$\implies x=9$$
Although I got one acceptable value of $x$, I couldn't get the other acceptable value of $x$, which is 1.
Process 2:
$$AB=\sqrt{(x-5)^2+0}$$
[Only positive root is taken as length is positive]
$$\implies 4=\sqrt{(x-5)^2}$$
$$\implies 16=(x-5)^2$$
[squaring both sides]
$$\implies x^2-10x+9=0$$
$$\implies x=1,9$$
Why does process 2 work and process 1 doesn't when both of them are legitimate processes?
This step is wrong, $\sqrt{a^2}$ does not simplify to $a$, but to $|a|$. Note that if $x-5=-4$, you still have $(x-5)^2=16$ and so $\sqrt{16}=4$. You'll get both solutions continuing from $4=|x-5|$.