If you check out the documentation for Application.Quit it starts by saying this:
Quits the player application. Shut down the running application. The Application.Quit call is ignored in the Editor.
Application.Quit does nothing if you test inside the editor.
load the next scene offscreen
Usually we switch scenes with get_tree().change_scene("res://Main.tscn");. We are not going to do that. Instead we will load the new scene as a resource (PackedScene) and then switch.
You can load the scene in a single call of load on the resource_loader, but that could mean a noticeable hiccup.
Instead, you could use ...