Villagers reset their workstations when a player sleeps in one of the village beds.
I discovered this bug in my "emerald farm", each villager is imprisoned in a "cell", with their associated workstation right in front of them (see picture).
When I created the farm, I made sure that the villagers were indeed associated with the workstation in front of them, the particles appeared well for the villager and for the workstation I had associated with them. Moreover, they were updating their trades after a certain period of time.
But at times all the villagers would lose their workstation and get another one.
After a lot of time and testing, I discovered that it was every time I slept in the bed associated with the village (there was only one for the village). When I sleep in the village bed, all the villagers reset their workstations, when I sleep in a bed that is not associated with the village (much further away), the villagers keep their workstations (as expected).
PS: I am French, this text was translated with DeepL, sorry for the mistakes.
Attachments
Comments 3

If there is only one bed and you sleep in it, or the villager linked to it is unable to sleep in it for any other reason, then you destroy the village and all workstation links. The next day when a villager finds the bed a new village with new, random workstation links is made. That is not a bug, it is just how villages work because they require villagers linked to beds.
If there is only one bed and you sleep in it, or the villager linked to it is unable to sleep in it for any other reason, then you destroy the village and all workstation links. The next day when a villager finds the bed a new village with new, random workstation links is made. That is not a bug, it is just how villages work because they require villagers linked to beds.