Minecraft wiki entry for Village_mechanics, associated text: A "house" is defined as a claimed bed. If the bed is obstructed by a solid block, villagers cannot pathfind to the bed and therefore cannot claim the bed.‌[Java Edition only] This causes anger particles to emit from the villager's head and from on top of the bed. If a villager succeeds in sleeping in an obstructed bed, the villager suffocates and dies without player intervention, leaving the bed unclaimed.