I’m not aware about the difference in speed, so I’ll suggest to check two things for now:
Either you happen to get a “huge” difference in Time.deltaTime in line 42:
float step = 10f * Time.deltaTime;
which is rather unlikely. Note, that this won’t make your player move framerate-independantly as you calculate the step value once and use it for many frames. More to that later.
Or, what I suspect to be the reason and this is more likely, is that you probably do not disable the player’s movement during the move-back-in-time-phase.
Off Topic due to request by OP
As you also asked for other things to be pointed out:
In order to move the player back in a framerate-independant manner, you should consider to calculate the value in each iteration again, just like for normal movements. As for that, remove the line above and change this line (48)
player.transform.position = Vector2.MoveTowards(player.transform.position, target, step);
to:
player.transform.position = Vector2.MoveTowards(player.transform.position, target, step*Time.deltaTime);
Next, your caching of the positions seems suboptimal if you only need the position that the player had 5 seconds ago (assuming you stick to the constant speed). You can calculate that on the fly (note, that this does not apply to the first 5 seconds):
cachedPosition.x = (player.transform.position.x - playersMoveSpeedPerSecond * seconds)
If you still want to cache the last 10 positions (e.g. speed changes so that the formula above does not apply), think about an array that you iterate over and once you reach the last element, start at the beginning again and overwrite the obsolete entries. You won’t have a continuously growing cache then.
And one more thing: is your cooldown supposed to start right over or do you wait in the cooldown coroutine until the player moved back and continues to play?