I think that might be the antivirus that runs the Forge installer in a sandbox so it doesn't actually do anything, try disabling it while you run the installer.
There are functions that define this. The default checks what kind of item things are and allows or denies various enchantments.
TieredItem only allows Unbreaking (because that's the default).