Vector3.MoveTowards works only in one direction

So I ran into a small problem while scripting my moving Platforms for the platformer im working on.

At first I save my beginning position, then move it to the target(MoveTowards()) and would like to move it back (MoveBack()) to its beginning, but that does not work.

Can you explain why?

Here is my C# code (My MoveTowards function is the same as Vector3.MoveTowards):

  void Start () {
            start = transform;
            moved = false;
    	}
    
        void Update()
        {
            if (trigger.GetComponent<TriggerPlatform>().triggered)
            {
                float step = speed * Time.deltaTime;
                if (!moved)
                    MoveTowards(step);
                else if (moved)
                    MoveBack(step);
    
                if (transform.localPosition == target.localPosition)
                    moved = true;
                else if (transform.localPosition == start.localPosition)
                    moved = false;
            }
        }
    
    
        void MoveTowards(float step)
        {
            transform.localPosition = MoveTowards(transform.localPosition, target.localPosition, step);
        }
    
        void MoveBack(float step)
        {
            transform.localPosition = MoveTowards(transform.localPosition, start.localPosition, step);
        }

your start variable is probably of type Transform so when you do

 start = transform;

now start is pointing to the same object in memory as transform so as you modify transform.position, that will also change start.position since those two position are the same.

What you need is to copy the position:

Vector3 start;

void Start(){
     start = transform.position;
}

Now, start is a Vector3 so it is a structure as opposed to a reference for Transform. Structure are passed by value so what happens in the Start is that the whole values of the position are copied to the start and modifying the position will not affect the start.