### 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 _edit_current(bool p_skip_foreign = false);
	void _dialog_display_save_error(String p_file, Error p_error);
	void _dialog_display_load_error(String p_file, Error p_error);
	void _menu_option(int p_option);
	void _menu_confirm_current();
	void _menu_option_confirm(int p_option, bool p_confirmed);
	void _android_build_source_selected(const String &p_file);
	void _request_screenshot();
	void _screenshot(bool p_use_utc = false);
	void _save_screenshot(NodePath p_path);
	void _tool_menu_option(int p_idx);
	void _export_as_menu_option(int p_idx);
	void _update_file_menu_opened();
	void _update_file_menu_closed();
	void _remove_plugin_from_enabled(const String &p_name);
	void _fs_changed();
	void _resources_reimported(const Vector<String> &p_resources);
	void _sources_changed(bool p_exist);
	void _node_renamed();
	void _editor_select_next();
	void _editor_select_prev();
	void _set_scene_metadata(const String &p_file, int p_idx = -1);
	void _get_scene_metadata(const String &p_file);
	void _update_title();
	void _update_scene_tabs();
	void _version_control_menu_option(int p_idx);
	void _close_messages();
	void _show_messages();
	void _vp_resized();
	void _titlebar_resized();