When an enchanted item is purchased twice consecutively by only right clicking/or tapping A on a controller (the first purchased item does not leave the selected item state) the game will crash after the second click/press. When shift clicking/tapping Y on a controller, multiple purchases can be made without a crash. Likewise, only right clicking once and manually placing the item into the inventory and making the second purchase with an empty cursor will not cause a crash.
I did further testing with an NBT editor and found that it is not exclusive to enchantments, but seems to apply to everything within a compound tag, including display tags and enchantment tags. Nor is it exclusive to tools and armor, it will also happen to enchanted books, and stacks of items. Buying named cobblestone for example (custom villager trades)
I was able to replicate this on both the Xbox and Windows 10 versions. Not on mobile however, due to the way the UI works for villager trading, it doesn't allow a double click.
Attached I have a clip of the game crashing on the second click of a purchase.