Can you not apply enchantments if enchantable = 0?

I'm trying to force an item to have an enchantment, but the item isn't enchantable, so I apply the below item modifier:

  "function": "minecraft:set_enchantments",
  "enchantments": {
    "minecraft:fire_protection": 1
  }
}```
Continue to help post