### 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 (drag_selection.size() > 0) {
					drag_type = DRAG_ROTATE;
					drag_from = transform.affine_inverse().xform(b->get_position());
					CanvasItem *ci = drag_selection[0];
					if (ci->_edit_use_pivot()) {
						drag_rotation_center = ci->get_global_transform_with_canvas().xform(ci->_edit_get_pivot());
					} else {
						drag_rotation_center = ci->get_global_transform_with_canvas().get_origin();
					}
					_save_canvas_item_state(drag_selection);
					return true;
				}
			}
		}
	}
	if (drag_type == DRAG_ROTATE) {
		
		if (m.is_valid()) {
			_restore_canvas_item_state(drag_selection);
			for (CanvasItem *ci : drag_selection) {
				drag_to = transform.affine_inverse().xform(m->get_position());
				
				bool opposite = (ci->get_global_transform().get_scale().sign().dot(ci->get_transform().get_scale().sign()) == 0);
				ci->_edit_set_rotation(snap_angle(ci->_edit_get_rotation() + (opposite ? -1 : 1) * (drag_from - drag_rotation_center).angle_to(drag_to - drag_rotation_center), ci->_edit_get_rotation()));
				viewport->queue_redraw();
			}
			return true;
		}
		
		if (b.is_valid() && b->get_button_index() == MouseButton::LEFT && !b->is_pressed()) {