Even if cats are obsessively tidy, they sometimes relieve themselves elsewhere than their litter box. These unexpected events are not pleasant, for you and for them.
A sudden need
Sometimes, cats have sudden needs they can't control. Depending on what "surprise" you get on your floor, you may understand it was an emergency. For example, if your pet suffers from diarrhoea, or if you find blood in its urine it means that your cat has cystitis. In this particular case, your pet was in pain and had to relieve itself quickly, and did not have time to go to their box. Sometimes, when cats are frightened, because of a noise or an other animal for example, they relieve themselves suddenly where they are.
"You're not tidy enough"
Beside these cases of absolute necessity, most of the time cats relieve themselves right next to their litter box because it's not clean enough for them. It's their way of telling you "Would you please clean up my litter box?". Like we do, cats don't really appreciate smelling and seeing their excrements. If you think the litter box is just a little bit untidy, for your cats it's absolutely filthy!
Exactly like us, cats are more or less obsessed with cleanliness. Some of them will need a perfectly clean litter box and others will be more flexible. If the litter box is clean and your cat keeps relieving itself nearby, maybe it's because you have changed the litter and they don't like the new one.
Aversion to the place
The environment around the litter box is important. If it has been modified (a new piece of furniture, a little bit of mess, unusual objects...) your cat might not like it anymore and even be afraid of it. For example, if you have recently purchased an automatic vacuum cleaner that turns on suddenly, your cat might have been frightened. It won't feel safe anymore in that place and will avoid it. It will start to relieve itself in other places such as bath tub or shower tray, because they look like a litter box and they are always clean!
A debilitating pain
When your cat gets old, striding over to the litter box edges can become difficult. It will prefer go to the litter box and stop in front of it, settle in comfortably and relieve itself on the floor. Offer them an easily accessible litter box, or settle an inclined plan. Don't hesitate to talk to your veterinarian about your cat's pain. Arthritis can be treated to make your cat's life easier, for example with alternative medicine.
And don't forget : if you notice excrement on your floor afterward, don't blame your cat. It has already forgotten.