Sometimes in my village, it seems an unemployed Villager claims a job site block that had already been claimed by another Villager, creating more jobs than there are job site blocks. (In the case of the screenshot, more Farmers than there are Composters.)
It at least has a relatively simple workaround. Just trap one of the two Villagers that claimed the same job site block so they can't reach it anymore and become unemployed. Then you can release them again and they'll realize they can't reclaim that same job site block and stay unemployed.
I am not sure what's causing this, but the village is typically unloaded (due to my base being too far away) and only gets loaded when I consciously visit it. Maybe it has something to do with unloading and reloading the chunks the village is in? Pressing F3+G shows me that these Composters are both in the same chunk, but the village itself is spread across several chunks. In particular, the beds of these Villagers are in a different chunk than the Composters.
As you can see in the screenshot, it shows three Farmers around two Composters. There are definitely no other Composters in the vicinity. Using the workaround described above, the third Farmer successfully became unemployed and stayed that way.
Related issues
Attachments
Comments


Seeing this as well. Have 4 lecterns, but 5 librarians. In addition, placing a 5th lectern does not give a 6th villager a job.

Having the same problem. It is keeping my master villagers from replenishing their inventory so it is very annoying. I haven't tried the trapping thing so I'll see if that works. I am also having the same issues with beds, I have like 20+ more villagers than beds so they just hang out in the town square at night, which is really annoying because I dont want my master villagers being killed in the middle of the night. I wish I could assign villagers like you can in Terraria with npcs to rooms. I am also on a server that kind of lags, so that might be why it's happening to me so often

My best guess is:
The village boundaries are too extended for villagers to be able to still find their way back to their claimed job site, their claimed bed or even the bell.
So when villagers wander off, due to restricted pathfinding abilities, at some point they are no longer able to find their way back and thus their job site goes unclaimed and can/will be claimed by another unemployed villager.
Just until that villager, too, wanders off too far… (and so on and on)
Resolutions may be:
Reducing the village boundaries to a range that matches the villagers' pathfinding abilities or
extending the pathfinding range of the villagers to match the distance across a village.
Workaround:
Confine certain villagers to their workplaces or reduce the reachable village boundaries with fences or barricades so that the villagers aren't able anymore to wander off too far.