The bug
The hitbox of villagers and baby villagers is too small when they are in a bed.
How to reproduce
Spawn a baby villager or a villager
Place a bed near the villager
Set the time to night
Press
F3+B
to show hitboxesLook at the villager's hitbox once it is in bed
Examples
[media][media]
Linked issues
is duplicated by 9
relates to 3
Attachments
Comments 19
still present in 20w18a
still present in 20w19a
still present in 20w20a
still present in 20w22a
Can confirm in 1.19.
Can confirm in 1.19.2.

I thought this is where the bug comes from (decompiled 1.20.2 using vanilla mapping:
net.minecraft.world.entity.LivingEntity.class
protected static final EntityDimensions SLEEPING_DIMENSIONS = EntityDimensions.fixed(0.2F, 0.2F);
...
public EntityDimensions getDimensions(Pose $$0) {
return ($$0 == Pose.SLEEPING) ? SLEEPING_DIMENSIONS : super.getDimensions($$0).scale(getScale());
}
and it affects MC-10919 as well.
No way that got added by accident.

Can confirm in 1.21.4.
still present in 20w16a