### 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)

if (last_id.is_valid()) {
				if (ObjectDB::get_instance(last_id) && last_object) {
					
					_collision_object_3d_input_event(last_object, camera_3d, ev, result.position, result.normal, result.shape);
					if (last_object->get_capture_input_on_drag() && mb.is_valid() && mb->get_button_index() == MouseButton::LEFT && mb->is_pressed()) {
						physics_object_capture = last_id;
					}
				}
			}
		} else {
			if (camera_3d) {
				Vector3 from = camera_3d->project_ray_origin(pos);
				Vector3 dir = camera_3d->project_ray_normal(pos);
				real_t far = camera_3d->far;
				PhysicsDirectSpaceState3D *space = PhysicsServer3D::get_singleton()->space_get_direct_state(find_world_3d()->get_space());
				if (space) {
					PhysicsDirectSpaceState3D::RayParameters ray_params;
					ray_params.from = from;
					ray_params.to = from + dir * far;
					ray_params.collide_with_areas = true;
					ray_params.pick_ray = true;
					bool col = space->intersect_ray(ray_params, result);
					ObjectID new_collider;
					CollisionObject3D *co = col ? Object::cast_to<CollisionObject3D>(result.collider) : nullptr;
					if (co && co->can_process()) {
						new_collider = result.collider_id;
						if (!capture_object) {
							last_object = co;
							last_id = result.collider_id;
							if (co->get_capture_input_on_drag() && mb.is_valid() && mb->get_button_index() == MouseButton::LEFT && mb->is_pressed()) {