### Godot version

4.1.beta (7b1387ff2)

### System information

Mageia 9, Linux

### Issue description

When opening an empty project in latest `master`, I get these errors:
```
ERROR: Index p_idx = -1 is out of bounds (edited_scene.size() = 1).
   at: get_scene_path (editor/scu/../editor_data.cpp:880)
ERROR: Index p_idx = -1 is out of bounds (edited_scene.size() = 1).
   at: check_and_update_scene (editor/scu/../editor_data.cpp:683)
ERROR: Index p_idx = -1 is out of bounds (edited_scene.size() = 1).
   at: set_edited_scene (editor/scu/../editor_data.cpp:745)
```

Possibly related to recent changes to restore past sessions, but there's nothing to restore in this case?

### Steps to reproduce

- Create a new project, edit it
- Quit to project manager
- Re-open the newly created project -> errors

### Minimal reproduction project

Empty project.
if (singleton->cmdline_export_mode) {
		print_line(p_task + ": begin: " + p_label + " steps: " + itos(p_steps));
	} else if (singleton->progress_dialog) {
		singleton->progress_dialog->add_task(p_task, p_label, p_steps, p_can_cancel);
	}
}
bool EditorNode::progress_task_step(const String &p_task, const String &p_state, int p_step, bool p_force_refresh) {
	if (singleton->cmdline_export_mode) {
		print_line("\t" + p_task + ": step " + itos(p_step) + ": " + p_state);
		return false;
	} else if (singleton->progress_dialog) {
		return singleton->progress_dialog->task_step(p_task, p_state, p_step, p_force_refresh);
	} else {
		return false;
	}
}
void EditorNode::progress_end_task(const String &p_task) {
	if (singleton->cmdline_export_mode) {
		print_line(p_task + ": end");
	} else if (singleton->progress_dialog) {
		singleton->progress_dialog->end_task(p_task);
	}
}
void EditorNode::progress_add_task_bg(const String &p_task, const String &p_label, int p_steps) {