Oh dear, not another one!
It could be that like Luna who had this problem not so long ago, kitty is associating the litter box with pain. It could also be a number of other things - a stressful environment, a change in the disinfectant you use, a change in the litter, doing it to punish you for something (I had a cat that urinated/defecated in the shower to punish me!) ... and so on and so forth.
All you can do is be as patient as possible (I know it is really really annoying) until you find the cause of the problem.
BTW Bastet's Mum - Pixel doesn't care about her litter box lid! Tonight when I had finished emptying her litter box, it was sitting in the middle of the laundry with it's top off. We could both see her from the kitchen, but she came in and did her biz with an unrepentant look on her face! She has no shame, that cat!