Hi Patrick,
Cats stop using their litter boxes for a variety of reasons, including issues with the box or litter, dissatisfaction with the placement or number of boxes, changes in the environment inside or outside the house, and undiagnosed medical conditions. You may have to investigate several possibilities before you understand what your cat is trying to tell you. Try to keep in mind that cats don't eliminate outside their litter box to purposefully annoy you. Punishment won't stop or correct the behavior. Since most cases of litter box avoidance are stress-related, punishment only increases the stress (for you and your kitty) and makes it harder to identify the real cause.
I would suggest putting litter boxes in he places your cat has decided to toilet and see if you can train them back into using one, or even dotting multiple around the rooms of your house to give plenty of option! It may be worth asking your vet incase there is something more sinister at play.
kind regards