My cat Nova is always in the box when she goes, but sometimes, she lifts her rear too high and pees over the side. I've seen her do it a couple times. She starts off at a good level but then slowly elevates her behind until she is peeing on the floor.
I got a covered box to see if that would help, and it did some. Unfortunately, I had to take the door off because neither of my cats could understand that it was, in fact, a door and not a wall. She ends up peeing right out the doorway sometimes.
I don't feel like this is a medical issue since it has been happening on and off for a long time now.