When a villager first go to sleep, they will not properly align themselves in the middle of the bed. Often times, they will sleep off to one of the edges of the block, or initially sleep in the center of the bed, and then move over due to thier momentum carrying over between states.
Steps to Reproduce:
Place down a few beds
(Recommended is >8 for ease of observation)Spawn an equal number of villagers
Turn time to night
/time set midnight
Observed & Expected Results:
❌ - The villagers will all go to sleep as expected, but some (if not all) will not be properly aligned with the center of the bed.
✔ - The villagers would sleep in the center of the bed, just as players do.
Screenshots/Videos:
[media][media]
Notes:
This is not about the villagers falling out of alignment when sleeping due to being pushed by a player, or another entity. That issue has been resolved as 'Working As Intended' previously. Instead, this is about the villagers not properly aligning themselves when they first enter a bed at night.
Original Description
(This is the original description by @unknown, before the issue was updated by @unknown)
The bug
Whilst villagers are sleeping, some of them are not aligned properly. Some of them are even stuck on the side of the bed.
Linked issues
is duplicated by 8
Attachments
Comments 8

Seems intended due to MC-145707

Well yes and no, I often see them lay offset in their beds if the beds are next to other beds who are also claimed by villagers. When the villagers goes to bed, their hitboxes may push each others around misaligning them when they lay down on their bed. So its most likely because the villagers are able to be pushed around when sleeping (as intended)
However I have also noticed this when villagers sleep in single bedrooms where no other entity is pushing them when they go to sleep, even thoug they will from time to time be offset when laying in their beds.
Perhaps its intertia from them moving towards the bed at the moment they switch to laying in the bed and that intertia pushes them a bit in the same direction they were moving before laying?
Can confirm in 20w51a. The player themselves are able to move them whilst they're sleeping.
Can confirm in 21w06a.
Requesting ownership of this issue, as it has not been kept up with since 2019 (Almost 5 years).
Affects 1.20.4.

Just noticed this for the first time after updating to 1.20.4.

I'm not a bug, it's a feature.
Looks like different skins due to different professions. Their heads seem to be in the same place.