Factory created object not deleted in time

I don’t think that’s possible. The proper way to fix this is to remove the enemy ID from the table as soon as it’s deleted. Defold expects you to not keep around references to deleted objects.