### 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
ERR_FAIL_COND(!p_node);
	Node *scene = EditorNode::get_singleton()->get_edited_scene();
	if (p_node != scene && p_node->get_owner() != scene && !scene->is_editable_instance(p_node->get_owner())) {
		return;
	}
	CanvasItem *ci = Object::cast_to<CanvasItem>(p_node);
	if (ci && !ci->is_visible_in_tree()) {
		return;
	}
	Transform2D parent_xform = p_parent_xform;
	Transform2D canvas_xform = p_canvas_xform;
	if (ci && !ci->is_set_as_top_level()) {
		parent_xform = parent_xform * ci->get_transform();
	} else {
		CanvasLayer *cl = Object::cast_to<CanvasLayer>(p_node);
		parent_xform = Transform2D();
		canvas_xform = cl ? cl->get_transform() : p_canvas_xform;
	}
	for (int i = p_node->get_child_count() - 1; i >= 0; i--) {
		_draw_invisible_nodes_positions(p_node->get_child(i), parent_xform, canvas_xform);
	}
	if (ci && !ci->_edit_use_rect() && (!editor_selection->is_selected(ci) || _is_node_locked(ci))) {
		Transform2D xform = transform * canvas_xform * parent_xform;
		// Draw the node's position
		Ref<Texture2D> position_icon = get_theme_icon(SNAME("EditorPositionUnselected"), SNAME("EditorIcons"));
		Transform2D unscaled_transform = (xform * ci->get_transform().affine_inverse() * ci->_edit_get_transform()).orthonormalized();