### 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.
docks_visible = p_show;
	_update_dock_slots_visibility(true);
}
bool EditorNode::get_docks_visible() const {
	return docks_visible;
}
void EditorNode::_toggle_distraction_free_mode() {
	if (EDITOR_GET("interface/editor/separate_distraction_mode")) {
		int screen = -1;
		for (int i = 0; i < editor_table.size(); i++) {
			if (editor_plugin_screen == editor_table[i]) {
				screen = i;
				break;
			}
		}
		if (screen == EDITOR_SCRIPT) {
			script_distraction_free = !script_distraction_free;
			set_distraction_free_mode(script_distraction_free);
		} else {
			scene_distraction_free = !scene_distraction_free;
			set_distraction_free_mode(scene_distraction_free);
		}
	} else {
		set_distraction_free_mode(distraction_free->is_pressed());
	}
}
void EditorNode::set_distraction_free_mode(bool p_enter) {