### Godot version

v4.1.rc3.official [cdd2313ba]

### System information

Godot v4.1.rc3 - Windows 10.0.19045 - Intel(R) Core(TM) i7-6700 CPU @ 3.40GHz (8 Threads)

### Issue description

Trying to open the filters (file types) menu in a non-exclusive FileDialog makes it automatically close and brings up the following error in the console/debugger:
```
ERROR: Condition "!windows.has(p_window)" is true. Returning: Rect2i()
   at: window_get_popup_safe_rect (platform/windows/display_server_windows.cpp:2426)
```
This seems to have been broken somewhere between 4.1 beta 2 and beta 3.

### Steps to reproduce

- Create a FileDialog
- Untick the "Exclusive" box
- Make it visible / pop it up / etc
- Try opening the `All Files (*)` menu

### Minimal reproduction project

[dialog_test.zip](https://github.com/godotengine/godot/files/11955537/dialog_test.zip)

Button *button = Object::cast_to<Button>(p_button);
	ERR_FAIL_NULL(button);
	ERR_FAIL_COND_MSG(button->get_parent() != buttons_hbox, vformat("Cannot remove button %s as it does not belong to this dialog.", button->get_name()));
	ERR_FAIL_COND_MSG(button == ok_button, "Cannot remove dialog's OK button.");
	if (button->is_connected("pressed", callable_mp(this, &AcceptDialog::_custom_action))) {
		button->disconnect("pressed", callable_mp(this, &AcceptDialog::_custom_action));
	}
	if (button->is_connected("pressed", callable_mp(this, &AcceptDialog::_cancel_pressed))) {
		button->disconnect("pressed", callable_mp(this, &AcceptDialog::_cancel_pressed));
	}
	Node *right_spacer = buttons_hbox->get_child(button->get_index() + 1);
	
	if (right_spacer) {
		buttons_hbox->remove_child(right_spacer);
		memdelete(right_spacer);
	}
	buttons_hbox->remove_child(button);
	child_controls_changed();
	if (is_visible()) {
		_update_child_rects();
	}
}
void AcceptDialog::_bind_methods() {