### 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 (pivot != se->prev_pivot || anchors[SIDE_LEFT] != se->prev_anchors[SIDE_LEFT] || anchors[SIDE_RIGHT] != se->prev_anchors[SIDE_RIGHT] || anchors[SIDE_TOP] != se->prev_anchors[SIDE_TOP] || anchors[SIDE_BOTTOM] != se->prev_anchors[SIDE_BOTTOM]) {
						se->prev_pivot = pivot;
						se->prev_anchors[SIDE_LEFT] = anchors[SIDE_LEFT];
						se->prev_anchors[SIDE_RIGHT] = anchors[SIDE_RIGHT];
						se->prev_anchors[SIDE_TOP] = anchors[SIDE_TOP];
						se->prev_anchors[SIDE_BOTTOM] = anchors[SIDE_BOTTOM];
						viewport->queue_redraw();
					}
				}
				if (ci->_edit_use_pivot()) {
					nb_having_pivot++;
				}
			}
			// Activate / Deactivate the pivot tool
			pivot_button->set_disabled(nb_having_pivot == 0);
			// Update the viewport if bones changes
			for (KeyValue<BoneKey, BoneList> &E : bone_list) {
				Object *b = ObjectDB::get_instance(E.key.from);
				if (!b) {
					viewport->queue_redraw();
					break;
				}
				Node2D *b2 = Object::cast_to<Node2D>(b);
				if (!b2 || !b2->is_inside_tree()) {
					continue;
				}
				Transform2D global_xform = b2->get_global_transform();
				if (global_xform != E.value.xform) {
					E.value.xform = global_xform;
					viewport->queue_redraw();