### 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 (theme == p_theme) {
		return;
	}
	theme = p_theme;
	theme_type_editor->set_edited_theme(p_theme);
	theme_edit_dialog->set_edited_theme(p_theme);
	for (int i = 0; i < preview_tabs_content->get_child_count(); i++) {
		ThemeEditorPreview *preview_tab = Object::cast_to<ThemeEditorPreview>(preview_tabs_content->get_child(i));
		if (!preview_tab) {
			continue;
		}
		preview_tab->set_preview_theme(p_theme);
	}
	theme_name->set_text(TTR("Theme:") + " " + theme->get_path().get_file());
}
Ref<Theme> ThemeEditor::get_edited_theme() {
	return theme;
}
void ThemeEditor::_theme_save_button_cbk(bool p_save_as) {
	ERR_FAIL_COND_MSG(theme.is_null(), "Invalid state of the Theme Editor; the Theme resource is missing.");
	if (p_save_as) {
		EditorNode::get_singleton()->save_resource_as(theme);
	} else {
		EditorNode::get_singleton()->save_resource(theme);
	}
}
void ThemeEditor::_theme_edit_button_cbk() {