It’s exactly the same situation as with sqrt:
sqrt
a = complex(-1) sqrt(a*a) == 1 sqrt(a)*sqrt(a) == -1