### Godot version

2992ffd25523cb8b3e0ef1b873c40115b8940178

### System information

Windows 10

### Issue description

Godot crashes randomly within a few seconds after project start when moving with the mouse.

![win_err](https://github.com/godotengine/godot/assets/52464204/1da28596-d95b-40f3-b32f-12219ec02c5d)

Started after recent merge of https://github.com/godotengine/godot/pull/67791.
I can confirm that reverting the pr fixes the crashes.

### Steps to reproduce

see desc

### Minimal reproduction project

N/A
Rect2i parent_rect;
	if (is_embedded()) {
		parent_rect = get_embedder()->get_visible_rect();
	} else {
		int screen_id = DisplayServer::get_singleton()->window_get_current_screen(get_window_id());
		parent_rect = DisplayServer::get_singleton()->screen_get_usable_rect(screen_id);
	}
	if (parent_rect != Rect2i() && !parent_rect.intersects(Rect2i(position, size))) {
		ERR_PRINT(vformat("Window %d spawned at invalid position: %s.", get_window_id(), position));
		set_position((parent_rect.size - size) / 2);
	}
	if (parent_rect != Rect2i() && is_clamped_to_embedder() && is_embedded()) {
		Rect2i new_rect = fit_rect_in_parent(Rect2i(position, size), parent_rect);
		set_position(new_rect.position);
		set_size(new_rect.size);
	}
	_post_popup();
	notification(NOTIFICATION_POST_POPUP);
}
bool Window::_try_parent_dialog(Node *p_from_node) {
	ERR_FAIL_NULL_V(p_from_node, false);
	ERR_FAIL_COND_V_MSG(is_inside_tree(), false, "Attempting to parent and popup a dialog that already has a parent.");
	Window *w = p_from_node->get_last_exclusive_window();
	if (w && w != this) {
		w->add_child(this);
		return true;
	}
	return false;
}
void Window::popup_exclusive(Node *p_from_node, const Rect2i &p_screen_rect) {