Moving a character based on a list of Vector 3’s

Moving a character based on a list of Vector 3’s

I have a client server scenario. On the server there is an AI character who chooses a random point on the map and pathfinds to it, when at that point it chooses a new point and pathfinds again etc. The path to each point is an array which I send to the client, then a character on the client goes to each point in the array, making it look as though it is in sync with the server's AI character. (I realise with Unet all I really need is a network identity script and  network transform component but this is a means to an end using this method). 
So when the server creates the array and sends its own AI character off on the path, this array is sent to the client, the client then puts it into a List. Then using this List the Clients character moves to each node smoothly looking just like the server. My problem is that sometimes it moves and others it sticks and I get an error 

"ArgumentOutOfRangeException: Argument is out of range. Parameter name: index" 

My code is as follows:
Script that sends path and receives:
public class AccessingTargetPos : NetworkBehaviour {
public List receivedArrays = new List(); 

[ClientRpc]
void RpcPosFromServerToGoTo(Vector3 [] path)
{
    UnityEngine.Debug.Log ("Going to ... " + path);
    receivedArrays.AddRange (path);
}


public void PrintPath(Vector3 [] path)
{
    if (isServer) 
    {
        UnityEngine.Debug.Log("Send Array ...");
        RpcPosFromServerToGoTo (path);
        UnityEngine.Debug.Log("Sent!!");

    } 
}

}

And my code that moves the client character based on the List:
public class ClientAiMoveToPosArray : MonoBehaviour {

AccessingTargetPos accessingTargetPos;
public float speed = 1;
public Vector3 endPoint;
int index = 0;
// Use this for initialization
void Start () 
{
    accessingTargetPos = GameObject.Find ("A*").GetComponent ();
}
// Update is called once per frame
void Update () 
{
    transform.position = Vector3.MoveTowards (transform.position, accessingTargetPos.receivedArrays [index], speed * Time.deltaTime);

    if(transform.position == accessingTargetPos.receivedArrays [index])
        {
            index++;
        }
}
}

I don't understand why I am getting this error and why at times my clients character sticks. I assume I am going wrong somewhere in my ClientAiMoveToPosArray script. Am I wrong in there somewhere?
UPDATE
The error occurs for 3 reasons:

At the beginning when the client has no point to move to i.e. I start the server then the array is generated, however the client hasn't connected yet. If the client connects when the AI is moving along a path it has to wait until a new path is generated before moving.
If the AI character on the server gets stuck in an unwalkable area.
If the client is moving exactly like the server AI character. The error is appears here because when the array is generated it has to be sent over to the client, resulting in a slight delay. 

Solutions/Answers:

Answer 1:

Apologies for taking so long, but following the update included in the original question, the error occurs for 3 reasons:

  1. At the beginning when the client has no point to move to i.e. I start the server then the array is generated, however the client hasn’t connected yet. If the client connects when the AI is moving along a path it has to wait until a new path is generated before moving.
  2. If the AI character on the server gets stuck in an unwalkable area.
  3. If the client is moving exactly like the server AI character. The error is appears here because when the array is generated it has to be sent over to the client, resulting in a slight delay.

References