I also found the issue in your skript, the extra quotations marks inside of you skript,
on item spawn of totem of undying:
wait 1 tick
execute console command "/kill @e[type=item,name= --> "Totem of Undying" <--]"
This causes skript to go brr. So basically if you just use the other skript it should work fine