the artificial intelligence is broken, sometimes the animatronic spends like 2 minutes at the door and a half or they do the jumpscare even if you have the door closed
It is possible for the AI to get into your room and wait for a bit inside your room before jumpscaring. It isn’t impossible to have them come in and close the door.