Villagers move when occupying the same hitbox. If they are in a bed, they appear to fly away. Sleeping in the bed makes them "Teleport" back to in front of the bed.
This location glitch seems to also be affecting other entities. Boats placed get stuck in blocks, and my favorite horse (with diamond armor...) disappeared after removing it from a boat.
Similarly, in realms, entities appear in different locations for each player who is logged in.
Minecraft for Win10 1.16.100
I have had issues with entities displaying in incorrect locations, mobs being able to attack me from further away than they should, my favorite horse disappeared when I broke the boat i was transporting it in, and villagers that show up in different locations for each player at the same time in multiplayer and in realms, and villagers that float away while sleeping in beds.
All of these seem to be related to entity location.