Index out of range in while statement but I can't figure out how.

Hi,
I need help with a while statement in a coroutine that gives me an error code; “ArgumentOutOfRangeException: Argument is out of range. Parameter name: index”. The error points to this line:

                while (selUnit.transform.position != movePath*.transform.position)*

What seems to happen is that the while-loop is always triggered the first time (regardless if I feed it 2 identical transform.positions or not), and when yielding back to the while statement it gives the error.
Now, I think I grasp the message means (index is out of range for the list movePath), but I just can’t see how.
movePath needs to be at least 2 items long to get past the if-statement and I’ve debugged it before and after the loop to make sure.
selUnit is not null, and I’ve made sure by logging it aswell.
Any help in explaining why this doesn’t work is much appreciated!
Here’s my code;
IEnumerator moveTo(List movePath)
{
if (movePath.Count > 1)
{
PlayerInput pInput = GetComponent();
Unit selUnit = GetComponent().selUnit;

for (int i = 1; i < movePath.Count; i++)
{
pInput.selUnit.movePoint = pInput.selUnit.movePoint - movePath*.moveCost;*
if (pInput.selUnit.movePoint < movePath*.moveCost)*
{
Debug.Log(“not enough movement points”);
pInput.selUnit.storedPath.AddRange((movePath.GetRange(i, movePath.Count - i)));
break;
}

while (selUnit.transform.position != movePath*.transform.position)*
{

pInput.ismoving = true;
pInput.selUnit.transform.rotation = Quaternion.LookRotation(pInput.selUnit.transform.position - movePath_.transform.position) * Quaternion.Euler(0, 90, 0);
pInput.selUnit.transform.position = Vector3.MoveTowards(pInput.selUnit.transform.position, movePath.transform.position, moveSpeed * Time.deltaTime);_

movePath*.unitOnHex = pInput.selUnit;*

Destroy(movePath*.selOnHex);*
movePath*.selOnHex = null;*

if (0 < i)
{
movePath[i - 1].unitOnHex = null;

}

yield return new WaitForEndOfFrame();
}
}

pInput.ismoving = false;

}
else
{
Debug.Log(“no movepath”);
}

}

If movePath has 2 elements in it, they’ll be movePath[0] and movePath[1]. movePath[2] would be out of range.
So you want movePath[i-1] (which, curiously, you use correctly elsewhere)