### 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
ERR_FAIL_INDEX_MSG(p_tab, preview_tabs_content->get_child_count(), "Attempting to open a preview tab that doesn't exist.");
	for (int i = 0; i < preview_tabs_content->get_child_count(); i++) {
		Control *c = Object::cast_to<Control>(preview_tabs_content->get_child(i));
		if (!c) {
			continue;
		}
		c->set_visible(i == p_tab);
	}
}
void ThemeEditor::_remove_preview_tab(int p_tab) {
	ERR_FAIL_INDEX_MSG(p_tab, preview_tabs_content->get_child_count(), "Attempting to remove a preview tab that doesn't exist.");
	ThemeEditorPreview *preview_tab = Object::cast_to<ThemeEditorPreview>(preview_tabs_content->get_child(p_tab));
	ERR_FAIL_COND_MSG(Object::cast_to<DefaultThemeEditorPreview>(preview_tab), "Attemptying to remove the default preview tab.");
	if (preview_tab) {
		preview_tab->disconnect("control_picked", callable_mp(this, &ThemeEditor::_preview_control_picked));
		if (preview_tab->is_connected("scene_invalidated", callable_mp(this, &ThemeEditor::_remove_preview_tab_invalid))) {
			preview_tab->disconnect("scene_invalidated", callable_mp(this, &ThemeEditor::_remove_preview_tab_invalid));
		}
		if (preview_tab->is_connected("scene_reloaded", callable_mp(this, &ThemeEditor::_update_preview_tab))) {
			preview_tab->disconnect("scene_reloaded", callable_mp(this, &ThemeEditor::_update_preview_tab));
		}
		preview_tabs_content->remove_child(preview_tab);
		preview_tabs->remove_tab(p_tab);
		_change_preview_tab(preview_tabs->get_current_tab());
	}
}
void ThemeEditor::_remove_preview_tab_invalid(Node *p_tab_control) {