### 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
List<CanvasItem *> selection;
	for (const KeyValue<Node *, Object *> &E : editor_selection->get_selection()) {
		CanvasItem *ci = Object::cast_to<CanvasItem>(E.key);
		if (ci && ci->is_visible_in_tree() && ci->get_viewport() == EditorNode::get_singleton()->get_scene_root() && (retrieve_locked || !_is_node_locked(ci))) {
			CanvasItemEditorSelectedItem *se = editor_selection->get_node_editor_data<CanvasItemEditorSelectedItem>(ci);
			if (se) {
				selection.push_back(ci);
			}
		}
	}
	if (remove_canvas_item_if_parent_in_selection) {
		List<CanvasItem *> filtered_selection;
		for (CanvasItem *E : selection) {
			if (!selection.find(E->get_parent())) {
				filtered_selection.push_back(E);
			}
		}
		return filtered_selection;
	} else {
		return selection;
	}
}
Vector2 CanvasItemEditor::_anchor_to_position(const Control *p_control, Vector2 anchor) {