How to fix the crafting recipe not working properly

When making a custom ingot in my datapack you also need 2 new items that are items with just custom model data and i works, but it also works with using the vanilla items. I have the same problem when upgrading a netherite sword to a better one and it accepts the vanilla smithing template and the vanailla netherite ingot :(( (The custom ingot resipe is in the picture - minecraft 1.21)
Continue to help post