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

case ANIM_INSERT_KEY:
		case ANIM_INSERT_KEY_EXISTING: {
			bool existing = p_op == ANIM_INSERT_KEY_EXISTING;
			_insert_animation_keys(true, true, true, existing);
		} break;
		case ANIM_INSERT_POS: {
			key_pos = key_loc_button->is_pressed();
		} break;
		case ANIM_INSERT_ROT: {
			key_rot = key_rot_button->is_pressed();
		} break;
		case ANIM_INSERT_SCALE: {
			key_scale = key_scale_button->is_pressed();
		} break;
		case ANIM_COPY_POSE: {
			pose_clipboard.clear();
			const HashMap<Node *, Object *> &selection = editor_selection->get_selection();
			for (const KeyValue<Node *, Object *> &E : selection) {
				CanvasItem *ci = Object::cast_to<CanvasItem>(E.key);
				if (!ci || !ci->is_visible_in_tree()) {
					continue;
				}
				if (ci->get_viewport() != EditorNode::get_singleton()->get_scene_root()) {
					continue;
				}
				if (Object::cast_to<Node2D>(ci)) {
					Node2D *n2d = Object::cast_to<Node2D>(ci);
					PoseClipboard pc;
					pc.pos = n2d->get_position();
					pc.rot = n2d->get_rotation();