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

viewport_scrollable->add_child(viewport);
	viewport->set_mouse_filter(MOUSE_FILTER_PASS);
	viewport->set_anchors_and_offsets_preset(Control::PRESET_FULL_RECT);
	viewport->set_clip_contents(true);
	viewport->set_focus_mode(FOCUS_ALL);
	viewport->connect("draw", callable_mp(this, &CanvasItemEditor::_draw_viewport));
	viewport->connect("gui_input", callable_mp(this, &CanvasItemEditor::_gui_input_viewport));
	viewport->connect("focus_exited", callable_mp(panner.ptr(), &ViewPanner::release_pan_key));
	h_scroll = memnew(HScrollBar);
	viewport->add_child(h_scroll);
	h_scroll->connect("value_changed", callable_mp(this, &CanvasItemEditor::_update_scroll));
	h_scroll->hide();
	v_scroll = memnew(VScrollBar);
	viewport->add_child(v_scroll);
	v_scroll->connect("value_changed", callable_mp(this, &CanvasItemEditor::_update_scroll));
	v_scroll->hide();
	viewport->add_child(controls_vb);
	// Add some margin to the left for better aesthetics.
	// This prevents the first button's hover/pressed effect from "touching" the panel's border,
	// which looks ugly.
	Control *margin_left = memnew(Control);
	main_menu_hbox->add_child(margin_left);
	margin_left->set_custom_minimum_size(Size2(2, 0) * EDSCALE);
	select_button = memnew(Button);
	select_button->set_flat(true);
	main_menu_hbox->add_child(select_button);
	select_button->set_toggle_mode(true);
	select_button->connect("pressed", callable_mp(this, &CanvasItemEditor::_button_tool_select).bind(TOOL_SELECT));
	select_button->set_pressed(true);
	select_button->set_shortcut(ED_SHORTCUT("canvas_item_editor/select_mode", TTR("Select Mode"), Key::Q));