There are cases in which CraftMetaEnchantedBook uses a non-ordered HashMap to store the enchantments of an enchanted book. Any NMS enchanted book ItemStack that has its stored enchantments in an order that does not match this non-deterministic order of the HashMap is prone to cause item comparison issues (CraftItemStack#equals, CraftItemStack#isSimilar) once the item stack is converted to a Bukkit ItemStack and then back to a NMS / Craft ItemStack.
Example reproduction plugin:
Create an enchanted book item in-game with a particular enchantment order:
Hold the item in your hand and right-click.
This conversion between Craft and Bukkit ItemStack can also occur in other situations, implicitly. Once converted to a Bukkit ItemStack, the enchantments are reordered. When converted back to a Minecraft ItemStack, this new enchantment order is preserved. Once two CraftItemStacks with differently ordered stored enchantments are compared, they are considered non-equal.