Just my two cents here, firstly McLaren were only there in the first place because of their one-stop plan. I think the pitwall knew how bad the Mediums were and realized that they needed to basically use the Softs as long as possible to be able to have a shot of having the 1 stop work.
The two stop wasn't ideal on paper but because of how garbage the mediums were, it meant that you could have two long soft stints with a mediocre medium stint. However, for the one stop, to avoid hemmorhaging time you had to spend around 35 laps for the soft stint at least to minimize how long you needed to be on the medium stint.
The original plan was obviously to extend all the way to 35 and then pit in order. However Lando when he locked up obviously needed to go in early (it was his own call and the right one for that moment)- but that would also put him on the backfoot as it was 5 laps more on the medium. They weren't going to compromise Oscar and put him on the medium early as well so extending was the right call.
Overall the last stint of the race was always going to be on a knife's edge due to the performance delta between the soft and the medium to begin with. Would it *possibly* have been better to pit Oscar 1 lap earlier in retrospect? Maybe, but we genuinely don't know and probably it wouldn't have anyways looking at how much faster Max was on the last stint with the softs. And while pitting Oscar right after Lando came in would've given him the net race lead it's entirely possible the mediums would've just degraded like they did on Lando and he would be even more of a sitting duck.
Frankly speaking, I think the pit wall did a pretty good job today doing a very high risk strategy- higher risk than people see because I think the pit wall always knew it would be very marginal at the end looking at how badly others did on the mediums. Up until around 8 laps to the end it didn't look like Lando was any slower than Oscar and swapping them anytime before then would hemmhorage them time, and swapping any *later* could've allowed Lando to tow Oscar down the straights to help defend but would've also made them vulnerable to get picked off.