The bug
If a villager take the bed of another villager then the latter will not look for new bed and will wander in the village without doing anything.
How to reproduce
Go to a village
Set the time to night
Observe what villagers do
Example
Here is an example in video:
[media]Linked issues
is duplicated by 3
Attachments
Comments 6
That's not the same issue. This issue has been fixed. See MC-197857 for remaining issues with villagers trying to enter occupied beds.
Even if there weren't any beds available, they should seek shelter inside a house instead of staying outside at night...