### 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
bottom_end_x = struts[11];
								} else {
									left_start_y = 0;
									left_end_y = desktop_rect.size.y;
									right_start_y = 0;
									right_end_y = desktop_rect.size.y;
									top_start_x = 0;
									top_end_x = desktop_rect.size.x;
									bottom_start_x = 0;
									bottom_end_x = desktop_rect.size.x;
								}
								const Point2i &pos = desktop_rect.position;
								const Size2i &size = desktop_rect.size;
								Rect2i left_rect(pos.x, pos.y + left_start_y, left, left_end_y - left_start_y);
								if (left_rect.size.x > 0) {
									Rect2i intersection = rect.intersection(left_rect);
									if (intersection.has_area() && intersection.size.x < rect.size.x) {
										rect.position.x = left_rect.size.x;
										rect.size.x = rect.size.x - intersection.size.x;
									}
								}
								Rect2i right_rect(pos.x + size.x - right, pos.y + right_start_y, right, right_end_y - right_start_y);
								if (right_rect.size.x > 0) {
									Rect2i intersection = rect.intersection(right_rect);
									if (intersection.has_area() && right_rect.size.x < rect.size.x) {
										rect.size.x = intersection.position.x - rect.position.x;
									}
								}
								Rect2i top_rect(pos.x + top_start_x, pos.y, top_end_x - top_start_x, top);
								if (top_rect.size.y > 0) {