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

CanvasItem *item = selection_results[0].item;
				selection_results.clear();
				_select_click_on_item(item, click, b->is_shift_pressed());
				return true;
			} else if (!selection_results.is_empty()) {
				
				selection_results.sort();
				NodePath root_path = get_tree()->get_edited_scene_root()->get_path();
				StringName root_name = root_path.get_name(root_path.get_name_count() - 1);
				for (int i = 0; i < selection_results.size(); i++) {
					CanvasItem *item = selection_results[i].item;
					Ref<Texture2D> icon = EditorNode::get_singleton()->get_object_icon(item, "Node");
					String node_path = "/" + root_name + "/" + root_path.rel_path_to(item->get_path());
					int locked = 0;
					if (_is_node_locked(item)) {
						locked = 1;
					} else {
						Node *scene = EditorNode::get_singleton()->get_edited_scene();
						Node *node = item;
						while (node && node != scene->get_parent()) {
							CanvasItem *ci_tmp = Object::cast_to<CanvasItem>(node);
							if (ci_tmp && node->has_meta("_edit_group_")) {
								locked = 2;
							}
							node = node->get_parent();
						}
					}
					String suffix;
					if (locked == 1) {
						suffix = " (" + TTR("Locked") + ")";