How can a plane fly far longer than designed? The current record for longest commercial flight is 21,602.22km by Boeing 777-200LR.

However the designed maximum range for B777-200LR is 15,800 km. So how is this possible?
The design range is fully loaded.  This flight had 35 passengers, no cargo, full fuel and was run as a project and flown by a test pilot.  It was not a commercial flight in the meaning that most people would recognise. 

They had to wait for weeks until the winds aloft, especially the jet stream, were at their most advantageous.