Creating a datapack to remove the Elytra (1.21.4)

Hi! I've never worked with datapacks before, and in general I'm not very advanced with programming etc. I've been trying to make a datapack that checks for Elytras in item frames and replaces them with air to effectively remove them from the game. I have a command that seems to work execute as @e[type=item_frame,nbt={Item:{id:"minecraft:elytra"}}] run data merge entity @s {Item:{id:"minecraft:air"}} when input in game, but it isn't doing anything inside of my datapack, even if i try to force the function with commands. What am I doing wrong? (if possible, i'll send images showing the folder and how I've set it up, but if not I'll describe it further below)
Continue to help post