Why is this raycast failing? The Gizmos show it hitting the object

Hi,

Can someone please look at these screenshots and code and let me know why the raycast is failing.
I do a check every frame to see if there is a ladder/rope at toe and shoulder level of the player.
I do this by doing a raycast 1 unit forward (with respect to the player) from shoulder and toe level markers.

Below is the code

    private void CheckLadderLevel()
    {
        //Raycast from shoulder level, to see if ladder is on shoulder level
        ladderAtShoulderLevel = Physics.Raycast(shoulderLevelMarker.transform.position, transform.forward, 1.0f, ladderLayers);
        if (ladderAtShoulderLevel)
        {
            Debug.DrawRay(shoulderLevelMarker.transform.position, transform.forward.normalized, Color.green, 1.0f);
        }
        else
        {
            Debug.DrawRay(shoulderLevelMarker.transform.position, transform.forward.normalized, Color.black, 1.0f);
        }
        //Raycast from toe level, to see if ladder is on toe level
        ladderAtToeLevel = Physics.Raycast(toeLevelMarker.transform.position, transform.forward, 1.0f, ladderLayers);
        if (ladderAtToeLevel)
        {
            Debug.DrawRay(toeLevelMarker.transform.position, transform.forward.normalized, Color.green, 1.0f);
        }
        else
        {
            Debug.DrawRay(toeLevelMarker.transform.position, transform.forward.normalized, Color.black, 1.0f);
        }
    }

If you see this picture, you can see the ray is going straight through the object

205364-rc02-raycast-seems-to-go-through-the-collider.png

This screenshot shows that it does indeed go through the colliders (and the layer setup)

One thing i would like to highlight is.
I successfully climb up and down the same rope/ladder multiple times, and this is happening at random times and not at the same spot.

I think i found the cause.
As you could see from my screenshots, my rope/ladder was made of multiple segments, each with its own collider and a trigger.

This problem happened when the ray went between two colliders/triggers.

I just fixed it by increasing the height of my triggers so there are no gaps between my segments.