### Godot version

Godot 4.0 beta 16

### System information

Windows 10 education 21H2, mobile renderer

### Issue description

trying to open the animation tab on animatedsprite2d causes a crash. Can also happen with animatedsprite3d but not as consistently.

### Steps to reproduce

open a new project, make an animationplayer and animatedsprite2d the children of root. Make a new animation in the animationplayer and add a new spriteframe to the animatedsprite2d. With both the spriteframe and animation tabs open on the bottom panel click on animation. In a larger project this seems to cause a crash immediately (first noticed on a project with 11 animations and animatedsprite2d with 9 frames), on a new project repeatedly clicking on the animation tab will cause the crash. If first clicking on another tab such as audio and then animation the project will default to the spriteframe tab. 

Tested and occurs in beta 16 and 15 but not in 14. Seems to only happen sometimes when using animatedsprite3d instead of animatedsprite2d.

![image](https://user-images.githubusercontent.com/61514710/215531634-19fd4970-2d34-4bf1-b186-8f4384fbca8a.png)


### Minimal reproduction project

n/a
void _version_button_pressed();
	void _update_undo_redo_allowed();
	int _save_external_resources();
	bool _validate_scene_recursive(const String &p_filename, Node *p_node);
	void _save_scene(String p_file, int idx = -1);
	void _save_all_scenes();
	int _next_unsaved_scene(bool p_valid_filename, int p_start = 0);
	void _discard_changes(const String &p_str = String());
	void _inherit_request(String p_file);
	void _instantiate_request(const Vector<String> &p_files);
	void _quick_opened();
	void _quick_run();
	void _open_command_palette();
	void _write_movie_toggled(bool p_enabled);
	void _run(bool p_current = false, const String &p_custom = "");
	void _run_native(const Ref<EditorExportPreset> &p_preset);
	void _reset_play_buttons();
	void _add_to_recent_scenes(const String &p_scene);
	void _update_recent_scenes();
	void _open_recent_scene(int p_idx);
	void _global_menu_scene(const Variant &p_tag);
	void _global_menu_new_window(const Variant &p_tag);
	void _dropped_files(const Vector<String> &p_files);
	void _add_dropped_files_recursive(const Vector<String> &p_files, String to_path);
	void _update_from_settings();
	void _renderer_selected(int);
	void _update_renderer_color();
	void _exit_editor(int p_exit_code);
	virtual void shortcut_input(const Ref<InputEvent> &p_event) override;
	bool has_main_screen() const { return true; }