Better us a functioncall using an keypress ingame.
I would not trust that manual debug typing of functions.

(or call automatically is after waiting some time in the mainfunction)

If it still not works, try to call the removal directly
within the entities action using the used indexnumber, then all entities should
be killed right away.