### Godot version

v4.2.dev.custom_build [c3b0a92c3]

### System information

Debian Linux X11 Xfce

### Issue description

In the following scene tree it is not possible to write anything in `LineEditB`.
![image](https://github.com/godotengine/godot/assets/6299227/ce5f696a-d86a-402f-98f7-6a762f15543e)

I would expect, that it is possible to focus `LineEditB` with a mouse click and write into it.

Regression from #58334

### Steps to reproduce

1. Load and run MRP
2. Mouse Click into the left LineEditB
3. Type Keyboard => No letters appear in the LineEditB

Variant:

1. Load and run MRP
2. Mouse Click into the right LineEditA
3. Mouse Click into the left LineEditB
4. Type Keyboard => Letters appear in LineEditA instead of LineEditB


### Minimal reproduction project

[BugKeyInputRouting.zip](https://github.com/godotengine/godot/files/11994804/BugKeyInputRouting.zip)

} else {
				last_id = physics_object_capture;
				last_object = capture_object;
			}
		}
		if (pos == last_pos) {
			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;