### Godot version

v4.2.rc.custom_build [702227129]

### System information

Godot v4.2.rc (702227129) - Debian GNU/Linux trixie/sid trixie - X11 - Vulkan (Forward+) - dedicated NVIDIA GeForce GTX 1060 6GB (nvidia) - AMD Ryzen 5 1600 Six-Core Processor (12 Threads)

### Issue description

Found a consistent crash when calling `hide()` from `_notification()`.
It does not happen if the call is deferred.

### Steps to reproduce

The `hide_test.gd` script has a boolean `cause_crash`. If it is true, hovering the mouse over the label crashes without an error in the Godot Editor Console. If it's false it hides the label as expected.

### Minimal reproduction project

[hide_crash.zip](https://github.com/godotengine/godot/files/13452818/hide_crash.zip)

ERR_THREAD_GUARD;
	gui.embed_subwindows_hint = p_embed;
}
bool Viewport::is_embedding_subwindows() const {
	ERR_READ_THREAD_GUARD_V(false);
	return gui.embed_subwindows_hint;
}
TypedArray<Window> Viewport::get_embedded_subwindows() const {
	TypedArray<Window> windows;
	for (int i = 0; i < gui.sub_windows.size(); i++) {
		windows.append(gui.sub_windows[i].window);
	}
	return windows;
}
void Viewport::subwindow_set_popup_safe_rect(Window *p_window, const Rect2i &p_rect) {
	int index = _sub_window_find(p_window);
	ERR_FAIL_COND(index == -1);
	gui.sub_windows.write[index].parent_safe_rect = p_rect;
}
Rect2i Viewport::subwindow_get_popup_safe_rect(Window *p_window) const {
	int index = _sub_window_find(p_window);
	
	
	if (index == -1) {
		return Rect2i();
	}
	
	return gui.sub_windows[index].parent_safe_rect;
}
void Viewport::pass_mouse_focus_to(Viewport *p_viewport, Control *p_control) {