二分遅れて着いていたら列車に乗り遅れるところだった。
If I had arrived two minutes later, I would have just missed the train.
I'm struggling to understand why this sentence uses 乗り遅れる rather than 乗り遅れた. At the time when I am two minutes late, I have already missed the train. The action of 乗り遅れる is already complete, so I would have expected 乗り遅れた.
I would have translated this as "I would have been just about to miss the train", suggesting that maybe the train left 3 minutes late.
Is my understanding of verb+ところ wrong? Does the counterfactual scenario maybe change how the grammar works? Or are both 乗り遅れる and 乗り遅れた acceptable here?
Edit
I've looked at the linked answer and this more recent post but still I remain rather confused. Here's another attempt to explain my confusion.
If I consider just
列車に乗り遅れるところだった
If I'm not mistaken it means
I was just about to miss the train
That is to say, I had not yet missed the train at the time being discussed. But somehow, adding 二分遅れて着いていたら in front changes things so that, in the hypothetical situation, I have already missed the train.
If the answer is simply "that's just the way it is" then that's fine. But I'd like to be sure I'm not missing some logical explanation.