Replace every mention (outside the exponent) of $i$, $-1$ and $1$ respectively by $X$, $X^2$ and $X^4$. This does not involve any ambiguity about signs or square roots or branch cuts, and uses only the always valid identities $i^2 = -1$, $(-1)^2 = 1$, and $(a^2)^2 = a^4$.
The argument now reads:
$ X = \sqrt{X^2} $
$ \sqrt{X^2} = (X^2)^{1/2} $
$ (X^2)^{1/2} = (X^2)^{2/4} $
$ (X^2)^{2/4} = ((X^2)^{2})^{1/4} $
$ ((X^2)^{2})^{1/4} = (X^4)^{1/4} $
$ (X^4)^{1/4} = 1 $
Some vertical equality signs are implied but not written.
All the equalities are either correct, or deduced from an axiom that $(T^{n})^{1/n} = T = (T^{1/n})^{n}$.
In each use of the axiom, $T$ is $X$, $X^2$ or $X^4$ and $n$ is $1,2$ or $4$.
The second equation in the axiom is correct. The first is not. There are difficulties in consistently choosing the sign of the square root, when working with complex numbers, and the first equation (in effect) pretends that a consistent choice of $n$-th root can always be made.