### 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_MAIN_THREAD_GUARD;
	if (p_use_own_world_3d == own_world_3d.is_valid()) {
		return;
	}
	if (is_inside_tree()) {
		_propagate_exit_world_3d(this);
	}
	if (p_use_own_world_3d) {
		if (world_3d.is_valid()) {
			own_world_3d = world_3d->duplicate();
			world_3d->connect_changed(callable_mp(this, &Viewport::_own_world_3d_changed));
		} else {
			own_world_3d = Ref<World3D>(memnew(World3D));
		}
	} else {
		own_world_3d = Ref<World3D>();
		if (world_3d.is_valid()) {
			world_3d->disconnect_changed(callable_mp(this, &Viewport::_own_world_3d_changed));
		}
	}
	if (is_inside_tree()) {
		_propagate_enter_world_3d(this);
	}
	if (is_inside_tree()) {
		RenderingServer::get_singleton()->viewport_set_scenario(viewport, find_world_3d()->get_scenario());
	}
	_update_audio_listener_3d();
}
bool Viewport::is_using_own_world_3d() const {