### 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.
ERR_FAIL_NULL(p_editing_owner);
	if (p_object && _is_class_editor_disabled_by_feature_profile(p_object->get_class())) {
		return;
	}
	Vector<EditorPlugin *> item_plugins;
	if (p_object) {
		item_plugins = editor_data.get_subeditors(p_object);
	}
	if (!item_plugins.is_empty()) {
		ObjectID owner_id = p_editing_owner->get_instance_id();
		List<EditorPlugin *> to_remove;
		for (EditorPlugin *plugin : active_plugins[owner_id]) {
			if (!item_plugins.has(plugin)) {
				
				to_remove.push_back(plugin);
				_plugin_over_edit(plugin, nullptr);
			}
		}
		for (EditorPlugin *plugin : to_remove) {
			active_plugins[owner_id].erase(plugin);