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

Node *owner = nullptr;
		int index = 0;
		
		Transform2D transform_2d;
		Transform3D transform_3d;
	};
	struct ConnectionWithNodePath {
		Connection connection;
		NodePath node_path;
	};
	struct ModificationNodeEntry {
		HashMap<StringName, Variant> property_table;
		List<ConnectionWithNodePath> connections_to;
		List<Connection> connections_from;
		List<Node::GroupInfo> groups;
	};
	void update_diff_data_for_node(
			Node *p_edited_scene,
			Node *p_root,
			Node *p_node,
			HashMap<NodePath, ModificationNodeEntry> &p_modification_table,
			List<AdditiveNodeEntry> &p_addition_list);
	bool is_scene_open(const String &p_path);
	void set_current_scene(int p_idx);
	void setup_color_picker(ColorPicker *p_picker);
	void request_instantiate_scene(const String &p_path);
	void request_instantiate_scenes(const Vector<String> &p_files);
	void set_convert_old_scene(bool p_old) { convert_old = p_old; }
	void notify_all_debug_sessions_exited();
	OS::ProcessID has_child_process(OS::ProcessID p_pid) const { return editor_run.has_child_process(p_pid); }