Problem:
I noticed that Villagers tries to get to bed through wall. They can't enter the wall, so stays stuck in the street after dusk, "cuddling" the wall on the opposite side from the bed.
If such wall destroyed, given Villager continues movement and jumps to bed.
I recorded a few interesting cases and put on youtube:
BedWall_Zombie https://youtu.be/c0RuVkR5FfE
BedWallTerracota https://www.youtube.com/watch?v=88CATtwOoas
BedWallNotepad https://www.youtube.com/watch?v=uZTv9suSF70
Work around:
Rearranging beds usually help, but no 100% fix. Rotating bed, placing elsewhere, moving to center of room sometimes helps.
Expected fix:
Pathfinder should not route through walls.
Version:
19w37a. I had to set 19w38b (I reverted from 19w38b b/c of defects) to file a bug.
Linked issues
duplicates
Comments

@unknown The bug is that the villager tries to enter through the wall rather than using the door to his house.

Is this happening in vanilla or using something like fabric?
I personally don't think this is a bug due to the villager AI trying to get to a bed when night enters.