### Godot version

Godot Engine v4.0.beta16.official.518b9e580

### System information

Linux, Vulkan, nvidia RTX 2070, Driver 525.60.11

### Issue description

Editor crashes when changing between theme editor and animation editor

Console:
`ERROR: Condition "slot >= slot_max" is true. Returning: nullptr
   at: get_instance (./core/object/object.h:962)
ERROR: Condition "slot >= slot_max" is true. Returning: nullptr
   at: get_instance (./core/object/object.h:962)

================================================================
handle_crash: Program crashed with signal 11
Engine version: Godot Engine v4.0.beta16.official (518b9e5801a19229805fe837d7d0cf92920ad413)
Dumping the backtrace. Please include this when reporting the bug to the project developer.
[1] /lib/x86_64-linux-gnu/libc.so.6(+0x42520) [0x7f908134c520] (??:0)
[2] /home/solorvox/GameDev/godot-engine/Godot_v4.0-beta16_linux.x86_64() [0x1c6d494] (??:0)
[3] /home/solorvox/GameDev/godot-engine/Godot_v4.0-beta16_linux.x86_64() [0x1c4eefe] (??:0)
[4] /home/solorvox/GameDev/godot-engine/Godot_v4.0-beta16_linux.x86_64() [0x44fb21a] (??:0)
[5] /home/solorvox/GameDev/godot-engine/Godot_v4.0-beta16_linux.x86_64() [0x26faf8b] (??:0)
[6] /home/solorvox/GameDev/godot-engine/Godot_v4.0-beta16_linux.x86_64() [0x448c994] (??:0)
[7] /home/solorvox/GameDev/godot-engine/Godot_v4.0-beta16_linux.x86_64() [0x2a9eb11] (??:0)
[8] /home/solorvox/GameDev/godot-engine/Godot_v4.0-beta16_linux.x86_64() [0x2a9eb8f] (??:0)
[9] /home/solorvox/GameDev/godot-engine/Godot_v4.0-beta16_linux.x86_64() [0x1c65ae0] (??:0)
[10] /home/solorvox/GameDev/godot-engine/Godot_v4.0-beta16_linux.x86_64() [0x42e50c2] (??:0)
[11] /home/solorvox/GameDev/godot-engine/Godot_v4.0-beta16_linux.x86_64() [0x44fb21a] (??:0)
[12] /home/solorvox/GameDev/godot-engine/Godot_v4.0-beta16_linux.x86_64() [0x2bcf06f] (??:0)
[13] /home/solorvox/GameDev/godot-engine/Godot_v4.0-beta16_linux.x86_64() [0x2bcfa7e] (??:0)
[14] /home/solorvox/GameDev/godot-engine/Godot_v4.0-beta16_linux.x86_64() [0x2b30f15] (??:0)
[15] /home/solorvox/GameDev/godot-engine/Godot_v4.0-beta16_linux.x86_64() [0x2b817d5] (??:0)
[16] /home/solorvox/GameDev/godot-engine/Godot_v4.0-beta16_linux.x86_64() [0x2b85781] (??:0)
[17] /home/solorvox/GameDev/godot-engine/Godot_v4.0-beta16_linux.x86_64() [0x2b85deb] (??:0)
[18] /home/solorvox/GameDev/godot-engine/Godot_v4.0-beta16_linux.x86_64() [0x2ba1cf5] (??:0)
[19] /home/solorvox/GameDev/godot-engine/Godot_v4.0-beta16_linux.x86_64() [0xe69114] (??:0)
[20] /home/solorvox/GameDev/godot-engine/Godot_v4.0-beta16_linux.x86_64() [0x42d5f34] (??:0)
[21] /home/solorvox/GameDev/godot-engine/Godot_v4.0-beta16_linux.x86_64() [0x42d6db5] (??:0)
[22] /home/solorvox/GameDev/godot-engine/Godot_v4.0-beta16_linux.x86_64() [0xe6ab2d] (??:0)
[23] /home/solorvox/GameDev/godot-engine/Godot_v4.0-beta16_linux.x86_64() [0xddd7c2] (??:0)
[24] /lib/x86_64-linux-gnu/libc.so.6(+0x29d90) [0x7f9081333d90] (??:0)
[25] /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0x80) [0x7f9081333e40] (??:0)
[26] /home/solorvox/GameDev/godot-engine/Godot_v4.0-beta16_linux.x86_64() [0xdfd8ee] (??:0)
-- END OF BACKTRACE --
================================================================`


### Steps to reproduce

Open included project
1) Click on AnimationPlayer in scene tree
2) Click on TextureRect in scene tree
4) Click on "Theme" editor at bottom of editor window (theme editor opens)
5) Click on "Animation" editor at bottom (crash)

Notes: The shader source code must be open, and a theme must be open to repeat this crash

### Minimal reproduction project

[animation-crash.zip](https://github.com/godotengine/godot/files/10530646/animation-crash.zip)

bool call_build();
	static EditorNode *get_singleton() { return singleton; }
	static EditorLog *get_log() { return singleton->log; }
	static EditorData &get_editor_data() { return singleton->editor_data; }
	static EditorFolding &get_editor_folding() { return singleton->editor_folding; }
	static HBoxContainer *get_menu_hb() { return singleton->menu_hb; }
	static VSplitContainer *get_top_split() { return singleton->top_split; }
	static String adjust_scene_name_casing(const String &root_name);
	static bool has_unsaved_changes() { return singleton->unsaved_cache; }
	static void disambiguate_filenames(const Vector<String> p_full_paths, Vector<String> &r_filenames);
	static void add_io_error(const String &p_error);
	static void progress_add_task(const String &p_task, const String &p_label, int p_steps, bool p_can_cancel = false);
	static bool progress_task_step(const String &p_task, const String &p_state, int p_step = -1, bool p_force_refresh = true);
	static void progress_end_task(const String &p_task);
	static void progress_add_task_bg(const String &p_task, const String &p_label, int p_steps);
	static void progress_task_step_bg(const String &p_task, int p_step = -1);
	static void progress_end_task_bg(const String &p_task);
	static void add_editor_plugin(EditorPlugin *p_editor, bool p_config_changed = false);
	static void remove_editor_plugin(EditorPlugin *p_editor, bool p_config_changed = false);
	static void add_plugin_init_callback(EditorPluginInitializeCallback p_callback);
	static void add_init_callback(EditorNodeInitCallback p_callback) { _init_callbacks.push_back(p_callback); }