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

grid_snap_active = p_status;
	viewport->queue_redraw();
}
void CanvasItemEditor::_button_override_camera(bool p_pressed) {
	EditorDebuggerNode *debugger = EditorDebuggerNode::get_singleton();
	if (p_pressed) {
		debugger->set_camera_override(EditorDebuggerNode::OVERRIDE_2D);
	} else {
		debugger->set_camera_override(EditorDebuggerNode::OVERRIDE_NONE);
	}
}
void CanvasItemEditor::_button_tool_select(int p_index) {
	Button *tb[TOOL_MAX] = { select_button, list_select_button, move_button, scale_button, rotate_button, pivot_button, pan_button, ruler_button };
	for (int i = 0; i < TOOL_MAX; i++) {
		tb[i]->set_pressed(i == p_index);
	}
	tool = (Tool)p_index;
	viewport->queue_redraw();
	_update_cursor();
}
void CanvasItemEditor::_insert_animation_keys(bool p_location, bool p_rotation, bool p_scale, bool p_on_existing) {
	const HashMap<Node *, Object *> &selection = editor_selection->get_selection();
	AnimationTrackEditor *te = AnimationPlayerEditor::get_singleton()->get_track_editor();
	te->make_insert_queue();
	for (const KeyValue<Node *, Object *> &E : selection) {
		CanvasItem *ci = Object::cast_to<CanvasItem>(E.key);
		if (!ci || !ci->is_visible_in_tree()) {
			continue;
		}