Pulled a Belichick
To perform something very well until the very end making it count for nothing.
The 2007 New England Patriots were on track for a perfect season when they "pulled a Belichick" and lost to the Giants.

"Ha, Frank was beating me really bad at pool until he pulled a Belichick and accidentally sank the eight ball"