Why does NavMeshAgent not change destination?

I needed an AI that would through a series of checkpoints that are empty objects within the game world. Here is the code for the AI, moving through rigidbody.

        public Transform[] checkpoints;
        private int i;
        private NavMeshAgent agent;
        private Rigidbody rb;
    
        [Header("Steering")]
        public float sight;
        public LayerMask layer;
        private bool onYourRight, onYourLeft;
    
        // Start is called before the first frame update
        void Start()
        {
            i = 0;
            agent = GetComponent<NavMeshAgent>();
            rb = GetComponent<Rigidbody>();
            agent.updatePosition = false;
            agent.updateRotation = false;
            agent.SetDestination(checkpoints[0].position);
    
        }
    
        // Update is called once per frame
        void Update()
        {
           if (agent.pathStatus == NavMeshPathStatus.PathComplete)
           {
              Debug.Log("YOU REACHED IT");
              i++;
              Debug.Log(i);
              this.agent.SetDestination(checkpoints*.position);*

}
}

private void FixedUpdate()
{
rb.velocity = agent.velocity;
agent.nextPosition = rb.position;
}
It should hit that if statement in Update() and move to the next checkpoint in the array. And yet it doesn’t. Why? What am I not seeing? What did I do wrong?
Please answer, this has been troubling me for the past hour.
----------
Update:
I diagnosed the problem in this. The agent skyrockets i to the last index so there is no where else to go. Changed update() to:
if (i < checkpoints.Length)
{
if (this.rb.position == checkpoints*.position)*
{
Debug.Log(“YOU REACHED IT”);
i++;
Debug.Log(i);
this.agent.SetDestination(checkpoints*.position);*
}
}
But now I got a new problem. It never goes to the next index.

Why are you mixing Rigidbody to this? Try taking out the FixedUpdate part of the code.

Also to check if Agent has reached the destination use (agent.remainingDistance <= agent.stoppingDistance). You can also try to set stoppingDistance a little over 0.

Here is simplified version (this assumes you set the Agent in the Inspector):

public class MoveTest : MonoBehaviour
{    
    public Transform[] checkpoints;
    public NavMeshAgent agent;
    int i;
    void Start()
    {
        i = 0;
        agent.SetDestination(checkpoints[0].position);
    }
    
    void Update()
    {
        if (i >= checkpoints.Length) return;
        if (agent.remainingDistance <= agent.stoppingDistance)
        {
            Debug.Log("YOU REACHED IT");
            Debug.Log(i);
            if (++i < checkpoints.Length) this.agent.SetDestination(checkpoints*.position); else agent.ResetPath();*

}
}
}