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

Node *scene = EditorNode::get_singleton()->get_edited_scene();
	_find_canvas_items_at_pos(p_pos, scene, r_items);
	
	for (int i = 0; i < r_items.size(); i++) {
		Node *node = r_items[i].item;
		
		if (node && node != get_tree()->get_edited_scene_root()) {
			node = scene->get_deepest_editable_node(node);
		}
		CanvasItem *ci = Object::cast_to<CanvasItem>(node);
		if (!p_allow_locked) {
			
			while (node && node != scene->get_parent()) {
				CanvasItem *ci_tmp = Object::cast_to<CanvasItem>(node);
				if (ci_tmp && node->has_meta("_edit_group_")) {
					ci = ci_tmp;
				}
				node = node->get_parent();
			}
		}
		
		bool duplicate = false;
		for (int j = 0; j < i; j++) {
			if (r_items[j].item == ci) {
				duplicate = true;
				break;
			}
		}