### 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)

bool bottom_panel_updating = false;
	Tree *disk_changed_list = nullptr;
	ConfirmationDialog *disk_changed = nullptr;
	bool scene_distraction_free = false;
	bool script_distraction_free = false;
	bool changing_scene = false;
	bool cmdline_export_mode = false;
	bool convert_old = false;
	bool immediate_dialog_confirmed = false;
	bool opening_prev = false;
	bool restoring_scenes = false;
	bool settings_changed = true; 
	bool unsaved_cache = true;
	bool waiting_for_first_scan = true;
	int current_menu_option = 0;
	SubViewport *scene_root = nullptr; 
	Object *current = nullptr;
	Ref<Resource> saving_resource;
	HashSet<Ref<Resource>> saving_resources_in_path;
	uint64_t update_spinner_step_msec = 0;
	uint64_t update_spinner_step_frame = 0;
	int update_spinner_step = 0;
	String _tmp_import_path;
	String external_file;
	String open_navigate;
	DynamicFontImportSettings *fontdata_import_settings = nullptr;
	SceneImportSettings *scene_import_settings = nullptr;
	AudioStreamImportSettings *audio_stream_import_settings = nullptr;
	String import_reload_fn;
	HashSet<String> textfile_extensions;