This entire scripts boils down to:
Do count what you’re spawning vs the number you’re expecting to have - do they match? Debug it, give them IDs, trace, see what you’re hitting.