### Godot version

v4.0.beta.custom_build [eaf306e0b]

### System information

Windows 10

### Issue description

Selecting a `Window` node in the Editor's SceneTree results in the message
```
editor/editor_data.cpp:1058 - Parameter "p_node" is null.
```
and the Inspector shows empty content instead of the Window's properties.

I would expect, that clicking on a node in the SceneTree lets me edit the properties of the node.

Bisecting shows that this behavior got introduced in #71770

### Steps to reproduce

1. Create a Window node
2. Click on the Window node in the Editor's SceneTree

### Minimal reproduction project

N/A
if (selection_results.size() == 1) {
				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) {