### 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 _open_imported();
	void _save_default_environment();
	void _update_update_spinner();
	void _resources_changed(const Vector<String> &p_resources);
	void _scan_external_changes();
	void _reload_modified_scenes();
	void _reload_project_settings();
	void _resave_scenes(String p_str);
	void _feature_profile_changed();
	bool _is_class_editor_disabled_by_feature_profile(const StringName &p_class);
	Ref<ImageTexture> _load_custom_class_icon(const String &p_path) const;
	void _pick_main_scene_custom_action(const String &p_custom_action_name);
	void _immediate_dialog_confirmed();
	void _select_default_main_screen_plugin();
	void _bottom_panel_switch(bool p_enable, int p_idx);
	void _bottom_panel_raise_toggled(bool);
	void _begin_first_scan();
	bool use_startup_benchmark = false;
	String startup_benchmark_file;
protected:
	friend class FileSystemDock;
	static void _bind_methods();
	void _notification(int p_what);
	int get_current_tab();
	void set_current_tab(int p_tab);
public:
	
	void _on_plugin_ready(Object *p_script, const String &p_activate_name);
	void editor_select(int p_which);
	void set_visible_editor(EditorTable p_table) { editor_select(p_table); }