There's a semi-colon after your if. That makes the lines after it not part of the IF, so they always run. If should be spraying errors about "`hit.transform is NULL`" after each miss.
The short red lines are usual. Unlike raycasts, Debug.DrawRay has the direction and distance together (`transform.forward*10` will make a longer line.)
I'd guess the code is otherwise working perfectly, but your `direction` empty is in the wrong spot. Try putting a cube (with no collider) on it, for a visual, or just select it while running in Scene view, or check every rotation while you're running. You might see something with the blue-arrow unexpectedly going down, putting "far forwards" exactly where the red lines are coming from.
[Edit: new from here down]
To really go nuts, check whether `direction` is what you think it is (make it a public global & check inspector while running.) Try printing `Debug.Log("fwd="+fwd);` to make sure fwd isn't really underground.