I have three cats. They live permanently indoors and have 24 hour access to their kitty litter except when I go to the toilet as it is a walk-through toilet and their room is only accessed through there. When I go to the toilet I close both doors because I don't particularly want cats in there with me! One of them either uses the kitty litter or pees in the bath, depending on which side she is on. If she really needs to go to the toilet why does she wait? If she doesn't need to go why does she when I'm in the toilet? When she goes in the bath I can see that it's only a small amount of urine so it doesn't seem that she really needs to go at that time.
Note to Americans: "go to the toilet" means "use the bathroom" to you.