### 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 _enable_pending_addons();
	void _dialog_action(String p_file);
	void _edit_current(bool p_skip_foreign = false);
	void _dialog_display_save_error(String p_file, Error p_error);
	void _dialog_display_load_error(String p_file, Error p_error);
	void _menu_option(int p_option);
	void _menu_confirm_current();
	void _menu_option_confirm(int p_option, bool p_confirmed);
	void _android_build_source_selected(const String &p_file);
	void _request_screenshot();
	void _screenshot(bool p_use_utc = false);
	void _save_screenshot(NodePath p_path);
	void _tool_menu_option(int p_idx);
	void _export_as_menu_option(int p_idx);
	void _update_file_menu_opened();
	void _update_file_menu_closed();
	void _remove_plugin_from_enabled(const String &p_name);
	void _plugin_over_edit(EditorPlugin *p_plugin, Object *p_object);
	void _fs_changed();
	void _resources_reimported(const Vector<String> &p_resources);
	void _sources_changed(bool p_exist);
	void _node_renamed();
	void _editor_select_next();
	void _editor_select_prev();
	void _save_editor_states(const String &p_file, int p_idx = -1);
	void _load_editor_plugin_states_from_config(const Ref<ConfigFile> &p_config_file);
	void _update_title();
	void _update_scene_tabs();
	void _version_control_menu_option(int p_idx);
	void _close_messages();