### 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
p->set_hide_on_checkable_item_selection(false);
	p->add_shortcut(ED_SHORTCUT("canvas_item_editor/skeleton_show_bones", TTR("Show Bones")), SKELETON_SHOW_BONES);
	p->add_separator();
	p->add_shortcut(ED_SHORTCUT("canvas_item_editor/skeleton_make_bones", TTR("Make Bone2D Node(s) from Node(s)"), KeyModifierMask::CMD_OR_CTRL | KeyModifierMask::SHIFT | Key::B), SKELETON_MAKE_BONES);
	p->connect("id_pressed", callable_mp(this, &CanvasItemEditor::_popup_callback));
	main_menu_hbox->add_child(memnew(VSeparator));
	override_camera_button = memnew(Button);
	override_camera_button->set_flat(true);
	main_menu_hbox->add_child(override_camera_button);
	override_camera_button->connect("toggled", callable_mp(this, &CanvasItemEditor::_button_override_camera));
	override_camera_button->set_toggle_mode(true);
	override_camera_button->set_disabled(true);
	_update_override_camera_button(false);
	main_menu_hbox->add_child(memnew(VSeparator));
	view_menu = memnew(MenuButton);
	// TRANSLATORS: Noun, name of the 2D/3D View menus.
	view_menu->set_text(TTR("View"));
	view_menu->set_switch_on_hover(true);
	view_menu->set_shortcut_context(this);
	main_menu_hbox->add_child(view_menu);
	view_menu->get_popup()->connect("id_pressed", callable_mp(this, &CanvasItemEditor::_popup_callback));
	p = view_menu->get_popup();
	p->set_hide_on_checkable_item_selection(false);
	grid_menu = memnew(PopupMenu);
	grid_menu->connect("about_to_popup", callable_mp(this, &CanvasItemEditor::_prepare_grid_menu));
	grid_menu->connect("id_pressed", callable_mp(this, &CanvasItemEditor::_on_grid_menu_id_pressed));
	grid_menu->set_name("GridMenu");
	grid_menu->add_radio_check_item(TTR("Show"), GRID_VISIBILITY_SHOW);
	grid_menu->add_radio_check_item(TTR("Show When Snapping"), GRID_VISIBILITY_SHOW_WHEN_SNAPPING);
	grid_menu->add_radio_check_item(TTR("Hide"), GRID_VISIBILITY_HIDE);