Hello,
I really have to recommend that you see a veterinarian for help with this. I would want to check things like hyperthyroidism or anything that might cause muscle loss or weakness. I would also be concerned about joints and joint pain causing him to to be reluctant to use the litter box. Maybe a pain medication like gabapentin or solensia might help. Also adding something like Purina hydra care or canned food with water added can help. My point is there are lots of things to talk about that might help the underlying cause for this.
I can’t fathom what this might be, though a toxicity comes to mind. Definitely get her to the vet.