### 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
Vector2 center(0.f, 0.f);
	Rect2 rect;
	int count = 0;
	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) {
			continue;
		}
		if (ci->get_viewport() != EditorNode::get_singleton()->get_scene_root()) {
			continue;
		}
		// counting invisible items, for now
		//if (!ci->is_visible_in_tree()) continue;
		++count;
		Rect2 item_rect;
		if (ci->_edit_use_rect()) {
			item_rect = ci->_edit_get_rect();
		} else {
			item_rect = Rect2();
		}
		Vector2 pos = ci->get_global_transform().get_origin();
		Vector2 scale = ci->get_global_transform().get_scale();
		real_t angle = ci->get_global_transform().get_rotation();
		Transform2D t(angle, Vector2(0.f, 0.f));
		item_rect = t.xform(item_rect);
		Rect2 canvas_item_rect(pos + scale * item_rect.position, scale * item_rect.size);
		if (count == 1) {
			rect = canvas_item_rect;