Surely if you queue_free() the object is destroyed and “number” will be gone?
Indeed, if number is stored in the node that’s being deleted when the number reaches 25, that’s your problem. You may want to store the number in another script (that isn’t attached to a node being deleted)