Why isn’t the scene changer stored on the global so you can call a function when needed instead of checking every frame in _physics_process?
Can you explain what you expect to happen versus what really happens? The code looks fine other than strange process and not using queue_free. It also won’t delete any node that aren’t direct children.
Make sure to format scripts surrounded by three ticks ```