I wouldn't be too concerned. Often frogs will flip on their back when they perceive danger (either real or not). Hopefully, your pacman will settle down. I suggest keeping the cage in a quiet location for a while.

If the flipping is associated with a health issue, like an infection or injury, then it would be cause for concern.