villagers can glitch through openings in a wall such as a single block hole in order to claim a bed on the other side of a wall
i have a no frills village that is completely enclosed until i rebulid the old one. at one point i had each villager in a seperate room with a bed and a 1 block hole in each side wall so they could gossip with other villagers. some of them wound up glitching through the window and claiming the bed leaving some rooms empty and other rooms with 2 or three villagers in them. this happened a short time after i updated to 1.14.4 pre-release 1. i have since reverted back to 1,14,3