I was able to reproduce this in version 1.20.40.
Steps to reproduce:
Create an isolated village / trading hall 100+ blocks away from any other village or bed or jobsite blocks.
Breed 10 villagers and make sure they all have beds and job sites to which they are linked.
Trade up existing 10 villagers to lock them into their professions.
Now breed 2 or more new villagers and have beds, but too few jobsite blocks. (e.g. 4 new villagers and 2 new jobsite blocks)
Make sure that the new jobsite blocks are not like the existing ones. If you have all librarians for first 10, create two grindstones which will be unlinked.
Try to time the 20 min grow time into adults so that the new villagers all grow into adults during nighttime while sleeping - this is key.
When the just grown and unemployed villagers awake (based on order they awake and try to take existing jobsite blocks) they may link to one of the already existing linked jobsite blocks of a traded up villager, who will relink to a different job block.
IF the traded up villager relinks to a different job type, they will switch jobs but keep their traded level. (there is an element of timing and luck involved here)
Even if you break their block and replace it with a different type, they will never switch back, they are stuck in the "new" job.
I hope this helps someone to find and fix the issue.
I was able to reproduce this in version 1.20.40, Bedrock for Windows.
Steps to reproduce:
Create an isolated village / trading hall 100+ blocks away from any other village or bed or jobsite blocks.
Breed 10 villagers and make sure they all have beds and job sites to which they are linked.
Trade up existing 10 villagers to lock them into their professions.
Now breed 2 or more new villagers and have beds, but too few jobsite blocks. (e.g. 4 new villagers and 2 new jobsite blocks)
Make sure that the new jobsite blocks are not like the existing ones. If you have all librarians for first 10, create two grindstones which will be unlinked.
Try to time the 20 min grow time into adults so that the new villagers all grow into adults during nighttime while sleeping - this is key.
When the just grown and unemployed villagers awake (based on order they awake and try to take existing jobsite blocks) they may link to one of the already existing linked jobsite blocks of a traded up villager, who will relink to a different job block.
IF the traded up villager relinks to a different job type, they will switch jobs but keep their traded level. (there is an element of timing and luck involved here)
Even if you break their block and replace it with a different type, they will never switch back, they are stuck in the "new" job.
I hope this helps someone to find and fix the issue.