So what's all this frantic behavior cats do when you lock yourself in the bathroom away from them, why are they overreacting? Let's take a look.
Why Cats Freak Out When you Use the Bathroom
Cat feels like they own the room, and you have closed off access to it. This greatly annoys the cat, just like if you were sent to your room. To check this theory, just close off access to another room the cat is allowed in. Your cat should run up to the door just like you're in the bathroom. It's basically, this is my Territory and you are blocking me from it.
The Running Water Freaks Them Out
Cats do not like water, especially lots of it. If your cat hears the shower running and you locked inside it would want to know what the heck is happening in there with you and if the water has gotten you. It is the same with flushing the toilet. You don't want your cat thinking Water is bad do you?