### Godot version

master

### System information

> Starting from Godot 4.1, you can copy this information to your clipboard by using Help > Copy System Info at the top of the editor window.

This crashed my editor 😆 

### Issue description


```
================================================================
CrashHandlerException: Program crashed
Engine version: Godot Engine v4.1.dev.mono.custom_build (72f7131be1be81e3b8c3d45732d55e5765b95dde)
Dumping the backtrace. Please include this when reporting the bug to the project developer.
[0] EditorNode::_get_system_info (C:\Users\zaevi\source\Godot\godot-source\editor\editor_node.cpp:4378)
[1] EditorNode::_menu_option_confirm (C:\Users\zaevi\source\Godot\godot-source\editor\editor_node.cpp:2900)
[2] CallableCustomMethodPointer<EditorNode,int>::call (C:\Users\zaevi\source\Godot\godot-source\core\object\callable_method_pointer.h:105)
[3] Callable::callp (C:\Users\zaevi\source\Godot\godot-source\core\variant\callable.cpp:51)
[4] Object::emit_signalp (C:\Users\zaevi\source\Godot\godot-source\core\object\object.cpp:1069)
[5] Node::emit_signalp (C:\Users\zaevi\source\Godot\godot-source\scene\main\node.cpp:3568)
[6] Object::emit_signal<int> (C:\Users\zaevi\source\Godot\godot-source\core\object\object.h:891)
[7] PopupMenu::activate_item (C:\Users\zaevi\source\Godot\godot-source\scene\gui\popup_menu.cpp:1822)
[8] PopupMenu::gui_input (C:\Users\zaevi\source\Godot\godot-source\scene\gui\popup_menu.cpp:453)
[9] CallableCustomMethodPointer<PopupMenu,Ref<InputEvent> const &>::call (C:\Users\zaevi\source\Godot\godot-source\core\object\callable_method_pointer.h:104)
[10] Callable::callp (C:\Users\zaevi\source\Godot\godot-source\core\variant\callable.cpp:51)
[11] Object::emit_signalp (C:\Users\zaevi\source\Godot\godot-source\core\object\object.cpp:1069)
[12] Node::emit_signalp (C:\Users\zaevi\source\Godot\godot-source\scene\main\node.cpp:3568)
[13] Window::_window_input (C:\Users\zaevi\source\Godot\godot-source\scene\main\window.cpp:1458)
[14] CallableCustomMethodPointer<Window,Ref<InputEvent> const &>::call (C:\Users\zaevi\source\Godot\godot-source\core\object\callable_method_pointer.h:104)
[15] Callable::callp (C:\Users\zaevi\source\Godot\godot-source\core\variant\callable.cpp:51)
[16] DisplayServerWindows::_dispatch_input_event (C:\Users\zaevi\source\Godot\godot-source\platform\windows\display_server_windows.cpp:2369)
[17] Input::_parse_input_event_impl (C:\Users\zaevi\source\Godot\godot-source\core\input\input.cpp:708)
[18] Input::flush_buffered_events (C:\Users\zaevi\source\Godot\godot-source\core\input\input.cpp:967)
[19] DisplayServerWindows::process_events (C:\Users\zaevi\source\Godot\godot-source\platform\windows\display_server_windows.cpp:2063)
[20] OS_Windows::run (C:\Users\zaevi\source\Godot\godot-source\platform\windows\os_windows.cpp:1478)
[21] widechar_main (C:\Users\zaevi\source\Godot\godot-source\platform\windows\godot_windows.cpp:181)
[22] _main (C:\Users\zaevi\source\Godot\godot-source\platform\windows\godot_windows.cpp:205)
[23] main (C:\Users\zaevi\source\Godot\godot-source\platform\windows\godot_windows.cpp:217)
[24] __scrt_common_main_seh (D:\a\_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl:288)
[25] <couldn't map PC to fn name>
-- END OF BACKTRACE --
================================================================
```

### Steps to reproduce

Change renderer to `gl_compatibility` and click `Help > Copy System Info`

### Minimal reproduction project

N/A
if (!scene_path.is_empty()) {
						required_load_paths.push_front(scene_path);
					}
					Ref<SceneState> inherited_state = original_node->get_scene_inherited_state();
					while (inherited_state.is_valid()) {
						String inherited_path = inherited_state->get_path();
						
						if (!inherited_path.is_empty()) {
							required_load_paths.push_front(inherited_path);
						}
						inherited_state = inherited_state->get_base_scene_state();
					}
					
					
					for (String path : required_load_paths) {
						if (!local_scene_cache.find(path)) {
							current_packed_scene = ResourceLoader::load(path, "", ResourceFormatLoader::CACHE_MODE_IGNORE, &err);
							current_packed_scene->set_path(path, true);
							local_scene_cache[path] = current_packed_scene;
						} else {
							current_packed_scene = local_scene_cache[path];
						}
					}
				}
				ERR_FAIL_COND(current_packed_scene.is_null());
				
				Node *instantiated_node = nullptr;
				if (current_packed_scene.is_valid()) {
					instantiated_node = current_packed_scene->instantiate(PackedScene::GEN_EDIT_STATE_INSTANCE);
				}