When I placed a bed on the second floor, the villagers behaved strangely because they couldn't reach it properly. They would just stand still directly below the bed without moving. Although I didn't film it, there was also a time when, even though there was a door, they prioritized going through the wall behind the bed and stuck to the wall.
Thank you for helping us improve Minecraft! We saved your files: