The bug
Villagers that lay in bed can disappear out of sight when looked at in a certain ways.
Video demonstrating the issue: https://youtu.be/7m_Ueur0EI8
Linked issues
is duplicated by 6
1 more links
MC-173649
Villager Disappears in Peripheral
Resolved
Attachments
Comments 1

I suspect that this is happening because villagers have a much smaller hitbox while sleeping.