She wants to go out, it's as simple as that. She's trapped because she's not allowed out. She can't talk but she's sure as hell dropping hints by sitting in the hallway.
Cats are free spirits. Yes, they love us to feed them and give them home comforts, but they also love to be able to come and go as and when they please.
It won't get any easier as she matures, it's her instincts telling her that she wants to go explore. And although female cats don't roam as far as males, believe me they still love to get out into the big wide world, even if that only means putting a little lead on her, as if she were a dog, and walking her round the garden or some green space.
We have cat flaps for our two moggies, one of each, and they come and go day or night. They'd be unbearable otherwise. Think about it: how'd you like being shut in all the time? How infuriatingly frustrating when your instincts are screaming at you and they're being denied, no matter how unwittingly.