After updating to version 1.21.9/1.21.10, I noticed that enchantments such as Sharpness—which are normally limited to swords and axes—can now be applied to items like pickaxes and helmets. Observe that the enchantment is accepted and functions, despite being inappropriate for the item type. This behavior is inconsistent with previous versions and may indicate a bug in the enchantment compatibility system.
Does MC-95555 describe your issue?