### 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.
}
		for (EditorPlugin *plugin : item_plugins) {
			if (active_plugins[owner_id].has(plugin)) {
				plugin->edit(p_object);
				continue;
			}
			for (KeyValue<ObjectID, HashSet<EditorPlugin *>> &kv : active_plugins) {
				if (kv.key != owner_id) {
					EditorPropertyResource *epres = Object::cast_to<EditorPropertyResource>(ObjectDB::get_instance(kv.key));
					if (epres && kv.value.has(plugin)) {
						
						epres->fold_resource();
					}
					kv.value.erase(plugin);
				}
			}
			active_plugins[owner_id].insert(plugin);
			_plugin_over_edit(plugin, p_object);
		}
	} else {
		hide_unused_editors(p_editing_owner);
	}
}
void EditorNode::push_node_item(Node *p_node) {
	if (p_node || Object::cast_to<Node>(InspectorDock::get_inspector_singleton()->get_edited_object()) || Object::cast_to<MultiNodeEdit>(InspectorDock::get_inspector_singleton()->get_edited_object())) {
		
		push_item(p_node);
	}
}
void EditorNode::push_item(Object *p_object, const String &p_property, bool p_inspector_only) {