Sometimes, Vanity Pets will do tricks!
Those who have a Vanity Pet, like the crazy space cat pets in Star Legends (here's a video: http://www.youtube.com/watch?v=709-rZMvZyQ) might notice that sometimes, the pet will do a trick. It will flip over on it's belly, or disappear underground. Silly pet!
If this happens to you and you really want your pet to straighten up and stop doing tricks, you can un-equip the pet and re-equip it. That will teach it! That, or move to another area and your pet will be back to normal.
For the math geeks out there, this is a result of the pet going into "Gimbal lock" You can read more about this on Wikipedia: http://en.wikipedia.org/wiki/Gimbal_lock