### 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.
ProjectSettings *ps = ProjectSettings::get_singleton();
	PackedStringArray enabled_plugins = ps->get("editor_plugins/enabled");
	for (int i = 0; i < enabled_plugins.size(); ++i) {
		if (enabled_plugins.get(i) == p_name) {
			enabled_plugins.remove_at(i);
			break;
		}
	}
	ps->set("editor_plugins/enabled", enabled_plugins);
}
void EditorNode::_plugin_over_edit(EditorPlugin *p_plugin, Object *p_object) {
	if (p_object) {
		editor_plugins_over->add_plugin(p_plugin);
		p_plugin->make_visible(true);
		p_plugin->edit(p_object);
	} else {
		editor_plugins_over->remove_plugin(p_plugin);
		p_plugin->make_visible(false);
		p_plugin->edit(nullptr);
	}
}
void EditorNode::_resources_changed(const Vector<String> &p_resources) {