The Bug:
When trying to trade an "unbreaking 2" book from a Journeyman Librarian for 25 emeralds and one book, it didn't show me the empty slot like it should, because I didn't have the book, but it worked as if I selected the next trade: 9 emeralds for one bookshelf, and when I tried to buy the bookshelf it worked and cost me 9 emeralds. My other Librarian villagers worked normally when I tried. I tried relogging into the world and then relogging into the game, but it did not help.
Steps to Reproduce:
Place down a command block and input the following command into it in order to summon a villager with the appropriate trades.
/summon minecraft:villager ~1 ~-0.5 ~1 {NoAI:1b,Offers:{Recipes:[{buy:{id:"minecraft:emerald",Count:5b},buyB:{id:"minecraft:book",Count:1b},sell:{id:"minecraft:enchanted_book",Count:1b,tag:{StoredEnchantments:[{lvl:3s,id:"minecraft:sharpness"}]}},maxUses:999},{buy:{id:"minecraft:emerald",Count:9b},sell:{id:"minecraft:bookshelf",Count:1b},maxUses:999}]}}
Obtain a stack of emeralds and activate the command block.
Make sure that you don't have any books within your inventory and click on the enchanted book trade.
Take note of how a different trade is selected.
Relates to MC-209286