Repro:
Breed a villager in a swamp biome.
Obtain desired trade by repeatedly. breaking and replacing the job site block. A lectern was used here until mending was obtained. The villager is a librarian profession.
Trade once to lock in the trade list.
Allow a zombie access to the villager to zombify him.
Cure the villager using a potion of weakness and golden apple.
Trade with the villager to master level.
Trade for the mend spell (novice level) and trade books to obtain emeralds until the maximum number is allowed for the day and these trades become temporarily blocked with a red X.
Allow the villager to become zombified again (accidentally) while the trade status is still blocked.
Cure the villager again and wait until trades should be unblocked again the next day.
Result: trades remain blocked forever.
Expected result: Trades should unblock as normal after a day.
I knew this. Your villager just sleep first, so they can fill up things. I think mojang do this to avoiding player slavering villager lol