Hi there and thnaks for this question.
Usually this behaviour will be due to anxiety or stress, though can also occur due to a medical reason, such as gut inflammation and diarrhea.
I'd look into if anything has changed recently; such as a new pet, altered routine or noisy construction work nearby.
She should have access to 2 clean trays at all times but I would not restrict her to one area (such as a playpen) which may make any anxiety worse.
For some cats, they have a litter preference, so changing litter can help. Similarly, they may prefer a certain type of tray (such as one with a roof).
She should always have access to 2 clean litter trays that are in quiet spots of the home where she has privacy.
Most cats wan to use a litter tray and be clean, so once we address any underlying problem, we'd hope this resolves soon.
Any places that have been soiled should be cleaned with an enzymatic cleaner, to eliminate the smell and help prevent re soiling.