I was having an issue where when I played the game, the enemies would instantly disappear instead of following the path. I tried adding debug logs to them following the index and when the object was destroyed, and found that it was only ever touching one waypoint, and then being deleted.
As it turns out, I had attached the else statement used to destroy the object onto the
if(transform.position == tragetPosition) statement, instead of the
if(waypointIndex < waypoints.Count) statement.
If you’re having a similar issue, I recommend starting by checking for that.