Edit: sorry I didn’t see this has already been reported, I hope I could at least offer more infos here - otherwise feel free to close the topic
My villagers are getting stuck on gates sometimes.
This has happened twice yet, the only solution is to demolish the gate and rebuild it.
It might have been caused by smoothing out the ground after building the walls, not entirely sure, but was the case in both of my cases.
Here is an example of this happening: