The mistake occurs in the first line: \(\sqrt{\frac{1}{-1}}\ne\frac{\sqrt1}{\sqrt{-1}}\)
Your subsequent development shows that equality here leads to an inconsistency.
We need to look at this as follows: \(\sqrt{\frac{1}{-1}}\rightarrow\sqrt{(\frac{1}{-1})}\rightarrow\sqrt{-1}=i\)
.