### 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
switch (p_event) {
		case DisplayServer::WINDOW_EVENT_MOUSE_ENTER: {
			_propagate_window_notification(this, NOTIFICATION_WM_MOUSE_ENTER);
			Window *root = get_tree()->get_root();
			DEV_ASSERT(!root->gui.windowmanager_window_over); 
			root->gui.windowmanager_window_over = this;
			notification(NOTIFICATION_VP_MOUSE_ENTER);
			if (DisplayServer::get_singleton()->has_feature(DisplayServer::FEATURE_CURSOR_SHAPE)) {
				DisplayServer::get_singleton()->cursor_set_shape(DisplayServer::CURSOR_ARROW); 
			}
		} break;
		case DisplayServer::WINDOW_EVENT_MOUSE_EXIT: {
			Window *root = get_tree()->get_root();
			DEV_ASSERT(root->gui.windowmanager_window_over); 
			root->gui.windowmanager_window_over->_mouse_leave_viewport();
			root->gui.windowmanager_window_over = nullptr;
			_propagate_window_notification(this, NOTIFICATION_WM_MOUSE_EXIT);
		} break;
		case DisplayServer::WINDOW_EVENT_FOCUS_IN: {
			focused = true;