Find all real numbers $a$, such that the equation has exactly two solutions:
$$ |x+1|+|2-x|=a^2-1$$
My reasoning:
Since the left side is always positive because of the absolute values, then $a^2-1\gt0$ ? But by solving that condition I get $a\in<-\infty,-1>\cup<1,+\infty>$ but the solution is $a\in<-\infty,-2>\cup<2,+\infty>$; why is this a wrong approach?
How to solve this correctly?

i would write the equation in the form $$|x+1|+|x-2|=a^2-1$$ 1: for $$x\geq 2$$ we have $$x+1+x-2=a^2-1$$ or $$x=\frac{a^2}{2}\geq 2$$ 2: $$-1\le x<2$$ form here we get $$a^2=4$$ last case: $$x<-1$$ then we get $$-x-1-x+2=a^2-1$$ thus $$x=\frac{2-a^2}{2}$$ and $$\frac{2-a^2}{2}<-1$$ can you finish?