Stuck with summon command not working

So when I enter my custom dimension I schedule this function for 20 ticks (without schduling it wasn't even doing the setblock command...). Now the setblock command works but the summon one doesn't and I can't figure out why.

The weird thing is I can run the command ingame and it works fine

Continue to help post