I noticed it happened when i wasn't paying attention and my character entered the door by brushing up against the side of the door frame on the inside of the door.
Then i tried to replicate this myself because i was confused and i only got it 2 work 3 out of 12 times.