I was listening to an interview and Outerage said that they were really practicing this exact situation and had thoroughly discussed it as late as that morning. He also said that he couldn't really see the other boat at all, just a black blur through a small window in the jib.
I think that Barker made an error having to dodge the first mark up the course that cost them a bit of the lead, possibly enough difference that Sweden was able to get close enough to create the penalty situation. If he had waited slightly longer to tack then he would have cleared the mark and not been dodging. These races come down to the smallest of differences, one error leads to another.
Of course, I say this from my arm chair and not at 30-40 knots with my heart hammering.