Villagers will randomly swap between unemployed and employed, losing their professions and trades and then making new trades.
I tried making a villager trading hall in 1.14.1 and I would have 3 lecterns and 3 villagers, and they would all become employed as librarians. At some point in the day though, 2/3 of these villagers become randomly unemployed, and maybe one of them will be switching between employed, and unemployed at a very rapid rate.
This issue didn't seem to be present in 1.14, and I tested both on a singleplayer world and a multiplayer world and the issue was in both.
Duplicate of MC-151079