### 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.
TTR("The current scene has unsaved changes.\nReload the saved scene anyway? This action cannot be undone."));
				confirmation->popup_centered();
				break;
			}
			int cur_idx = editor_data.get_edited_scene();
			_remove_edited_scene();
			Error err = load_scene(filename);
			if (err != OK) {
				ERR_PRINT("Failed to load scene");
			}
			editor_data.move_edited_scene_to_index(cur_idx);
			EditorUndoRedoManager::get_singleton()->clear_history(false, editor_data.get_current_edited_scene_history_id());
			scene_tabs->set_current_tab(cur_idx);
		} break;
		case FILE_SHOW_IN_FILESYSTEM: {
			String path = editor_data.get_scene_path(editor_data.get_edited_scene());
			if (!path.is_empty()) {
				FileSystemDock::get_singleton()->navigate_to_path(path);
			}
		} break;
		case RUN_SETTINGS: {
			project_settings_editor->popup_project_settings();
		} break;
		case FILE_INSTALL_ANDROID_SOURCE: {
			if (p_confirmed) {
				export_template_manager->install_android_template();
			} else {
				if (DirAccess::exists("res:android/build")) {
					remove_android_build_template->popup_centered();
				} else if (export_template_manager->can_install_android_template()) {