I had a librarian villager selling mending, and then it reset its trade to Efficiency 5 for absoloutely no reason. Did not break its bed or job site. The villager is in a house that I made.
How to reproduce:
1. Get a librarian villager.
2. Break and replace its job site once.
3. Wait ~1 ingame day outside of the village.
Expected results: Villager has same trades as before.
Observed results: Villager resets trades.
Workaround: Trade with the villager after you get the trade you want.
Could you please attach video or screenshots of the issue with the debug info enabled (F3)?