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

if (singleton->cmdline_export_mode) {
		print_line(p_task + ": begin: " + p_label + " steps: " + itos(p_steps));
	} else if (singleton->progress_dialog) {
		singleton->progress_dialog->add_task(p_task, p_label, p_steps, p_can_cancel);
	}
}
bool EditorNode::progress_task_step(const String &p_task, const String &p_state, int p_step, bool p_force_refresh) {
	if (singleton->cmdline_export_mode) {
		print_line("\t" + p_task + ": step " + itos(p_step) + ": " + p_state);
		return false;
	} else if (singleton->progress_dialog) {
		return singleton->progress_dialog->task_step(p_task, p_state, p_step, p_force_refresh);
	} else {
		return false;
	}
}
void EditorNode::progress_end_task(const String &p_task) {
	if (singleton->cmdline_export_mode) {
		print_line(p_task + ": end");
	} else if (singleton->progress_dialog) {
		singleton->progress_dialog->end_task(p_task);
	}
}
void EditorNode::progress_add_task_bg(const String &p_task, const String &p_label, int p_steps) {