Can Someone explain why the racast is only hitting the on the first two collisions.

The issue i am having is that when I attempt to use a ray to check for colliders I am only hitting the first two times. the test environment is set up with a generic plane, and two cubes on top of the plane. These objects are placed in a straight line on the x-axis. The first two rays hit the plane an report the correct information and translate the ray to the appropriate position. The third ray misses the plane. removing the fail checks runs the loop and translates the ray all 100 times successfully yet fails to hit after the first two loops anyway. scaling the plane will cause the ray check to succeed up to 7 times.

What is causing these failures?

       RaycastHit Hit;
       public  Vector3 RayPosition;
       public Vector3 Rayendpoint;
       public float raylength;
       public bool TestDone;
       int Fails;

        void Start()
        { 
            RayPosition = new Vector3(0, 10, 0);
            TestDone = false;
        }

        void FixedUpdate()
        {
            if (TestDone == false)
            {
            RayChecker();
            }
        }


        void RayChecker()
        {

        for (int i = 0; i < 100f; i++)
        {
            int MaxFails = 10;
            Rayendpoint = new Vector3(RayPosition.x, RayPosition.y - raylength, RayPosition.z);

            Debug.DrawLine(RayPosition, Rayendpoint, Color.red, 360f, false);
            if (Physics.Raycast(RayPosition, Rayendpoint, out Hit, 360f))
            {
                Debug.Log(Hit.collider.name);
                Debug.DrawLine(RayPosition, Rayendpoint, Color.yellow, 360f, false);
                Debug.Log(RayPosition + "  :  " + Rayendpoint);
                RayPosition.x++;
            }
            else if (Fails == MaxFails)
            {
                break;
            }
            else
            {
                Debug.Log("FAil");
                Fails++;
            }
        {

        }


        }
            Debug.Log("LOOPDONE");
            TestDone = true;

        }

I just realized that i was attempting to define an endpoint(Such as the one called for in the DrawLine method) instead of a direction. By replacing Physics.Raycast(RayPosition, Rayendpoint, out Hit, 360f) with Physics.Raycast(RayPosition, Vector3.down, out Hit, 15f) the ray is hitting as expected. My issue has been resolved.