If a villager have a workstation and a player sleep the villager unlink from that station and went th sleep animation end and a new day start will link to a workstation, in case of multiple workstation of same type the villager link ramdomly even if the workstation its 10 block away, and have other the same type next to him.
Step to reproduce:
Spawn 3 villagers in cells
Give a workstatios of same type
Player sleep
Result
Workstation mix even if the station aren't the nearest to the villager
Note:by test I discover this issue only happen if villager don't have beds, if they have they went wake up don't get unlink from the original workstarion
Please fix faster you could, this is make me crazy in my trading hall and the villager don't get restoral of the trades due this issue
Villages are defined by beds. If no villager is linked to a bed then there is no village and no workstation links can exist. If a villager cannot sleep in its bed at night it will delink. So if you are sleeping in the only bed near your villagers, then you are destroying the village every night. This is not a bug.
You may want to look for help on the Minecraft wiki, Reddit, or discord, or look for Bedrock videos on YouTube.