### Godot version

4.0.2

### System information

Windows 10,Radeon RX 550/550 Series,23.3.2,Vulkan

### Issue description

After Switching to the animations tabs and pressing the key symbol because I wanted to know what it does, Godot crashes

### Steps to reproduce

Go into a project 
Switch to the Animations Tab, make sure no animation is active 
And then press on the key symbol

here is a video demonstrating the bug

https://user-images.githubusercontent.com/59411880/233839816-5489899e-828f-4ac9-9de3-7914f727f754.mp4



### Minimal reproduction project

The File
[package.zip](https://github.com/godotengine/godot/files/11303712/package.zip)

key_scale_button = memnew(Button);
	key_scale_button->set_flat(true);
	key_scale_button->set_toggle_mode(true);
	key_scale_button->set_focus_mode(FOCUS_NONE);
	key_scale_button->connect("pressed", callable_mp(this, &CanvasItemEditor::_popup_callback).bind(ANIM_INSERT_SCALE));
	key_scale_button->set_tooltip_text(TTR("Scale mask for inserting keys."));
	animation_hb->add_child(key_scale_button);
	key_insert_button = memnew(Button);
	key_insert_button->set_flat(true);
	key_insert_button->set_focus_mode(FOCUS_NONE);
	key_insert_button->connect("pressed", callable_mp(this, &CanvasItemEditor::_popup_callback).bind(ANIM_INSERT_KEY));
	key_insert_button->set_tooltip_text(TTR("Insert keys (based on mask)."));
	key_insert_button->set_shortcut(ED_SHORTCUT("canvas_item_editor/anim_insert_key", TTR("Insert Key"), Key::INSERT));
	key_insert_button->set_shortcut_context(this);
	animation_hb->add_child(key_insert_button);
	key_auto_insert_button = memnew(Button);
	key_auto_insert_button->set_flat(true);
	key_auto_insert_button->set_toggle_mode(true);
	key_auto_insert_button->set_focus_mode(FOCUS_NONE);
	key_auto_insert_button->set_tooltip_text(TTR("Auto insert keys when objects are translated, rotated or scaled (based on mask).\nKeys are only added to existing tracks, no new tracks will be created.\nKeys must be inserted manually for the first time."));
	key_auto_insert_button->set_shortcut(ED_SHORTCUT("canvas_item_editor/anim_auto_insert_key", TTR("Auto Insert Key")));
	key_auto_insert_button->set_shortcut_context(this);
	animation_hb->add_child(key_auto_insert_button);
	animation_menu = memnew(MenuButton);
	animation_menu->set_shortcut_context(this);
	animation_menu->set_tooltip_text(TTR("Animation Key and Pose Options"));
	animation_hb->add_child(animation_menu);
	animation_menu->get_popup()->connect("id_pressed", callable_mp(this, &CanvasItemEditor::_popup_callback));
	animation_menu->set_switch_on_hover(true);
	p = animation_menu->get_popup();