Exponentiation returning negative value or zero value when should be positive

If I use the exponentiation operator in the terminal for a positive integer to itself, sometimes it returns a negative value or returns zero. Below is two screen shots.

Screen Shot 2022-06-06 at 11.08.40 AM

Screen Shot 2022-06-06 at 11.17.44 AM

Could someone explain why this could be occurring? Or if there is a fix.