When a villager claims a bed or a workstation, there is no check to see if the villager can actually reach them. This can cause undesired behaviour, such as villagers claiming players' beds or workstations inside a player's enclosed base.
Villagers will pathfind to these points of interest when using them. It's not unreasonable for them to pathfind when claiming them, even if they don't actually walk to them.
The screenshot (desert villagers in a desert superflat world) has three farmer villagers wandering to reach beds they have previously claimed with no path to the beds. They are farmers because they claimed the composters despite having no path to the composters.
Linked issues
Attachments
Comments 4
absolute game breaking glitch. . . .villagers need to find next unclaimed workstation of the same type (or bed) that they can get to.
This glitch already is in process of being fixed at MC-149835 (even though this ticket isn't actually a duplicate)