You did everything right, your cat was comfortable, yet she started having accidents?
Before you weep into your pillow, take her to the vet.
It can be hard to identify a sick cat, but accidents are a robust clue. Think painful infection, inflamed urinary tract, or developing kidney, liver, or thyroid problems.
For more on innocent accidents, see this at Cornell University.