I suppose you are talking about Chizza. If so, you'll need to quickly close the door before she gets into your office.
Alternatively, you can close the door on her before she even gets to your door, But I recommend you wait for a bit (Depending on the speed of the Animatronic) before doing so, As the door isn't unlimited.
I was able to beat the first night, so I can assume it's just bad luck or something, rather than a bug (could be wrong, Idk).
Thank you for your feedback, if you have any other problems you found in the game, Feel free to let me know. :)