When multiple villagers are trying to enter a house simultaneously they will sometimes spam the door as they each try to open it but half the time close it.
Go to a village/build a house and spawn villagers
Ensure there are at least 2 villagers by the door
Make it night or spawn a zombie
Watch as they spam the door to try and get in