Why the hell does this command not work in a main.mcfunction but it does work when i manually run it

execute as @e[type=item] if items entity @s contents barrel[custom_name='{"extra":[{"italic":false,"text":"Class Table"},{"font":"aeternum:gui","text":"\\u0003"},{"color":"white","font":"aeternum:gui","text":""}],"text":""}'] run kill @s

I am utterly confused

Continue to help post