### Godot version

4.1 beta2

### System information

Windows 10 Home

### Issue description

I had a control with a custom theme which i removed. When loading the project again the Theme Editor is opened and some actions, like Show Default or Override All, cause the editor to crash.

### Steps to reproduce

1. create a scene with a Control node
2. add a custom theme to it
3. click the theme so the Theme Editor opens
4. remove the theme
5. save the scene
6. close the project and open it again (Theme Editor needs to be opened when closing the project)
7. click Show Default or Override All

### Minimal reproduction project

[Godot41_themeEditorCrash.zip](https://github.com/godotengine/godot/files/11760454/Godot41_themeEditorCrash.zip)

void _dock_popup_exit();
	void _dock_floating_close_request(WindowWrapper *p_wrapper);
	void _dock_make_selected_float();
	void _dock_make_float(Control *p_control, int p_slot_index, bool p_show_window = true);
	void _scene_tab_changed(int p_tab);
	void _proceed_closing_scene_tabs();
	bool _is_closing_editor() const;
	void _scene_tab_closed(int p_tab, int p_option = SCENE_TAB_CLOSE);
	void _scene_tab_hovered(int p_tab);
	void _scene_tab_exit();
	void _scene_tab_input(const Ref<InputEvent> &p_input);
	void _reposition_active_tab(int idx_to);
	void _thumbnail_done(const String &p_path, const Ref<Texture2D> &p_preview, const Ref<Texture2D> &p_small_preview, const Variant &p_udata);
	void _scene_tab_script_edited(int p_tab);
	Dictionary _get_main_scene_state();
	void _set_main_scene_state(Dictionary p_state, Node *p_for_scene);
	int _get_current_main_editor();
	void _save_editor_layout();
	void _load_editor_layout();
	void _save_docks_to_config(Ref<ConfigFile> p_layout, const String &p_section);
	void _restore_floating_dock(const Dictionary &p_dock_dump, Control *p_wrapper, int p_slot_index);
	void _load_docks_from_config(Ref<ConfigFile> p_layout, const String &p_section);
	void _update_dock_slots_visibility(bool p_keep_selected_tabs = false);
	void _dock_tab_changed(int p_tab);
	void _save_central_editor_layout_to_config(Ref<ConfigFile> p_config_file);
	void _load_central_editor_layout_from_config(Ref<ConfigFile> p_config_file);
	void _save_open_scenes_to_config(Ref<ConfigFile> p_layout);
	void _load_open_scenes_from_config(Ref<ConfigFile> p_layout);
	void _update_layouts_menu();
	void _layout_menu_option(int p_id);