### 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.
String scene_file_path = p_node->get_scene_file_path();
	
	if (p_node->get_scene_file_path() == p_instance_path) {
		p_instance_list.push_back(p_node);
	} else {
		Node *current_node = p_node;
		Ref<SceneState> inherited_state = current_node->get_scene_inherited_state();
		while (inherited_state.is_valid()) {
			String inherited_path = inherited_state->get_path();
			if (inherited_path == p_instance_path) {
				p_instance_list.push_back(p_node);
				break;
			}
			inherited_state = inherited_state->get_base_scene_state();
		}
	}
	for (int i = 0; i < p_node->get_child_count(); i++) {
		Node *child = p_node->get_child(i);
		find_all_instances_inheriting_path_in_node(p_root, child, p_instance_path, p_instance_list);
	}
}
void EditorNode::reload_instances_with_path_in_edited_scenes(const String &p_instance_path) {
	int original_edited_scene_idx = editor_data.get_edited_scene();
	HashMap<int, List<Node *>> edited_scene_map;
	
	
	for (int i = 0; i < editor_data.get_edited_scene_count(); i++) {
		if (editor_data.get_scene_path(i) != p_instance_path) {