One of them was on watch duty (or having a smoke outside at least). Sure, it was convenient that he stood in the line of fire, but nowhere near implausible. Why would any of them be out taking a piss when they've seemingly captured their biggest threat? That wouldn't make sense. Of course they all wanted to see what happened.
You can never get a "perfect ending" that everyone is happy with. Everyone will want something different. Some people wanted Walter to fail miserably and be shot in the head by King Nazi and some wanted Walter to figure out a cure for cancer while in the cut, go back and save Jesse and murder all nazis using only his fists. I can see why you may not like the ending, because somehow all the pieces just fell right in place for Walter, but you really should be prepared for that to happen after watching five seasons of the show. That's how the show has worked from the very first episode. Walter always got a break just when he needed it. Even if you don't like the ending calling it "ridiculously badly written" is surely an overstatement.