### 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
ERR_READ_THREAD_GUARD_V(0);
	return theme_owner->get_theme_default_font_size();
}
void Window::begin_bulk_theme_override() {
	ERR_MAIN_THREAD_GUARD;
	bulk_theme_override = true;
}
void Window::end_bulk_theme_override() {
	ERR_MAIN_THREAD_GUARD;
	ERR_FAIL_COND(!bulk_theme_override);
	bulk_theme_override = false;
	_notify_theme_override_changed();
}
Rect2i Window::get_parent_rect() const {
	ERR_READ_THREAD_GUARD_V(Rect2i());
	ERR_FAIL_COND_V(!is_inside_tree(), Rect2i());
	if (is_embedded()) {
		
		Node *n = get_parent();
		ERR_FAIL_NULL_V(n, Rect2i());
		Viewport *p = n->get_viewport();
		ERR_FAIL_NULL_V(p, Rect2i());
		return p->get_visible_rect();
	} else {
		int x = get_position().x;
		int closest_dist = 0x7FFFFFFF;
		Rect2i closest_rect;
		for (int i = 0; i < DisplayServer::get_singleton()->get_screen_count(); i++) {
			Rect2i s(DisplayServer::get_singleton()->screen_get_position(i), DisplayServer::get_singleton()->screen_get_size(i));