I've read recently that a cat peeing in unusual places can be due to its having cystitis. It goes off its litter tray as it associates the tray with peeing painfully, so looks for somewhere to pee that isn't painful.
I've also been told very recently that Go-Cat dried food is often found to be being fed to cats which develop cystitis...
I have also had cats that took to peeing or even pooing indoors when the ground outdoors was not suitable for them to dig their holes or to pee on - frozen solid, covered in snow, too muddy. I had one cat, Mixture, who used to come for a late night walk with me and the dog; one icy night he was trying to find somewhere to toilet and kept crying in frustration and running to another spot, trying to dig, crying and moving on. It was hilarious at first but then we took pity on him and dug through the ice for him under a bush.
I guess that other reasons to make the cat unhappy to venture outside could also lead to indoor toiletting.
And yes, I have had several cats that insisted on a clean litter tray or it was too awful to be considered.