### 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
state["show_transformation_gizmos"] = show_transformation_gizmos;
	state["snap_rotation"] = snap_rotation;
	state["snap_scale"] = snap_scale;
	state["snap_relative"] = snap_relative;
	state["snap_pixel"] = snap_pixel;
	return state;
}
void CanvasItemEditor::set_state(const Dictionary &p_state) {
	bool update_scrollbars = false;
	Dictionary state = p_state;
	if (state.has("zoom")) {
		// Compensate the editor scale, so that the editor scale can be changed
		// and the zoom level will still be the same (relative to the editor scale).
		zoom = real_t(p_state["zoom"]) * MAX(1, EDSCALE);
		zoom_widget->set_zoom(zoom);
	}
	if (state.has("ofs")) {
		view_offset = p_state["ofs"];
		previous_update_view_offset = view_offset;
		update_scrollbars = true;
	}
	if (state.has("grid_offset")) {
		grid_offset = state["grid_offset"];
	}
	if (state.has("grid_step")) {
		grid_step = state["grid_step"];
	}
	if (state.has("primary_grid_steps")) {
		primary_grid_steps = state["primary_grid_steps"];
	}