I was reading about evaluating $i^i$ so I tried that with Mathematica and got a real (R) result and Mathematica suggested an alternative form being $e^{-pi/2}$ so I solved for $\pi$:
$i^i = e^{-\pi/2}$
$i \cdot \ln(i) = -\pi/2$
$-2i\cdot\ln(i) = \pi$
from there:
$\cos\left(-2i \cdot\ln(i)\right) = -1 \iff \cos\left(2i\cdot\ln(i)\right) = -1$
$\cos\left(2i \cdot\ln(i)\right) = -1$
$2i\cdot\ln(i) = \arccos(-1) = \pi$
so we get: $\pi = -2i \cdot \ln(i) = 2i \cdot \ln(i)$
so what did go wrong?
This is done is the wrong you've done (only it's slightly hidden away): $$ x=y\\ \cos (x)= \cos( y)\\ \cos (-x)= \cos (y)\\ -x=y $$ In essence, just because two cosines are equal, doesn't mean the arguments are.