This is a game breaking bug, villagers will get stuck inside blocks below them, phase through blocks and sleep on the floor beside beds and in all sorts of angles on top of their beds and even in mid air, all contributing to them phasing through blocks. Whatever you guys changed in this hotfix really broke villagers honestly a rollback seems necessary for realms and the game as a whole.
The simple solution to this issue is to load in entities last after terrain structures ect.