Sergio Perez was frustrated after having a lap time deleted, before it was later reinstated, helping him to get into Q2, but using an extra set of tyres that he didn't need to use because of the mistake.
Hamilton's struggles continued, and he will start his final race as a Mercedes driver down in 18th.
The seven-time champion is set to move to Ferrari from next season, ending his highly-successful 12-season spell with the Brackley outfit.