We have three cats and one is very persnickety and picky. My kids are supposed to scoop out solid waste and flush it every morning & evening but sometimes that doesn't happen. I can always tell when it's not done properly because Sasha will pee beside the tub (she never poops outside of the box though, thankfully). The one time they did start pooping in the utility room it was where their box originally was when we moved in. So we simply placed a small box there and that problem was solved.
I can always tell when Sasha's nose is out of joint with me because she'll pee beside the tub right in front of me. I just remembered that she did poop outside of the box one other time and it was the day I gave her a bath to soothe/heal her skin inflammation after a nasty flea infestation. She pooped right in the middle of my bed. Sigh.... We did rule out that Sasha didn't have a UTI or some other problem so with her it's behavioral too.
I talked to the vet about it, and she said cats are extremely picky, some more so than others. She told me that for her cats, she actually didn't use proper "litter" boxes at all. She went out and bought several long, shallow plastic storage tubs and she only placed a shallow layer of litter in it each day. She then completely disposed of the litter every evening.
I haven't tried that but I have noted that with Sasha, having the lid on her box vs. off does make a difference. It doesn't matter how clean that box was. If the lid was off, it was a no go. While I don't dispose of my litter every day, I do keep a shallow layer in the box and changes it 2 or 3 times a week.
Have you tried a non clay litter (paper, wood, corn cob, etc.)? I use wood and as the cat pees in it, the pellets break down and expand so I often wind up with much more litter in the box than what I originally added. It's naturally scented too, which I like vs. the heavy perfumes in scented cat litter. It's not good for the fur balls and I don't care for it because I'm sensitive to synthetic scents.
There are usually recommendations on the back of the bag of litter on how to switch it with a new brand or type. I have to admit though that I will often go cold turkey with my cats on a type of litter and the only time I had a problem was when I had to use clay litter (because of budget issues). Come to think of it, that's the time they started going in the utility room. They really didn't like it! LOL I wound up using strips of torn news print instead for a few days until I could get the type of litter they were used to. While I often buy wood, they've also used paper and even wheat. It comes in pellets.
Since the vet indicated it sounds like behavioral vs. a physical problem I would try her with other types of litter, how often you dispose of the waste & litter, even placement of the box. See if that helps. If she wasn't always like this and it only started after she was ill, there's something going on in her environment that she doesn't like. Just observe you kitty. It may take a while, and lots of experimentation but it's worth it. Good luck!