This job swapping bug has also happened to me and my MC world was literally created after update 1.16.100.
I had a librarian villager, I moved his bed and he changed what he was selling. It was a mending 1 book at 34 emeralds and swapped to piercing for like 12 emeralds.
I had already traded with him and got him to level 2 to attempt to lock in the mending book as his trade. I am hugely frustrated with this bug because after the auto fishing farms were "fixed" I am now forced to try and get mending books through trading and have missed out twice due to this dang bug... last time the librarian straight up switched to being a farmer.
PS: I am running Minecraft on my Xbox One.
Pretty much @Endomusik. I recommend that if you died near trees you search high and low for your stuff. Relogging as the previous user mentioned is also a possibility.
I believe the main issue is that the client side of the game vs the server side of the game actually relays two different positions for the items in question. You just gotta get lucky and find the server side positioning. I sincerely doubt they will ever put out a viable fix that will permanently patch this bug.