When setting villager trades (via commands), tools have a data tag as Damage:0 which is not applied to normal tools. So if you try to trade an unbroken tool for something, you cannot because it doesn't have that data tag.
What I expected to happen was...: the unbroken tool should be able to trade since they should be identical items.
What actually happened was...: the unbroken tool was not able to be traded because it had an extra Damage:0 tag in the code (even though there was none) that made normal tools not fit the requirements
Steps to Reproduce:
1. Enter the command, "/summon villager ~ ~ ~ {Offers:{Recipes:[{maxUses:999999,buy:{id:diamond_sword,Count:1},sell:{id:diamond,Count:1}}]}}
2. Pres F3 + H to show hidden tooltips
3. Open the trading menu of that villager
4. Try to trade a normal diamond sword for a diamond
5. Notice that the diamond sword in the trading menu has an extra nbt tag.
6. This will not allow for the item to be traded.
This is caused by MC-136352