The Rebels determine the flaw in the Death Star by analysing the plans. That is, the flaw appears in the design, not the implementation.
Ted Mosby was wrong - it was the architect's fault, not the contractor's.
(And, yes, I'm aware that I'm responding to a drunken argument made by a fictional character about a fictional device in a fictional universe. I'm just not sure I care.)