The second seed, who was a set up, went over on his ankle midway through the second set and, despite playing on to win the game, he was forced to quit with the score 6-4 3-2 in his favour.
Muller will now face Matthew Ebden for a place in the semi-finals after the Australian beat James Blake of the US 6-7(6) 6-4 6-4.
Top seed John Isner was also pushed to three sets, but the American recovered from a set down to win 4-6 6-3 6-4 against Ruben Bemelmans.
Isner now meets compatriot Jack Sock, the youngster completing the quarter-final line-up with a 7-6(5) 7-6(5) win over another American Steve Johnson.
Defending champion Marcel Granollers was sent tumbling out of ATP Gstaad in a one-sided 6-4 6-2 second-round defeat to Lukasz Kubot.
The Spanish world number 20, seeded second in Switzerland, was ousted by the 30-year-old Pole in one hour and 37 minutes.
Kubot will face highly-rated young Bulgarian Grigor Dimitrov in the quarter-finals after he beat Germany’s Dustin Brown 7-6(3) 3-6 6-2.
Another seed, Columbia’s Santiago Giraldo, also crashed out, losing 6-3 2-6 6-4 to Jan Hernych of the Czech Republic.
Veteran Hernych, ranked 188th in the world, has never won an ATP title. And he must face Serbian star Janko Tipsarevic after he ousted Austrian Martin Fischer 6-2 -4.
In Hamburg, third seed Juan Monaco of Argentina reached the quarter-finals of the event for the first time with a 7-6(4) 6-3 victory over Spain’s Daniel Munoz.
Monaco, ranked 14th in the world, needed just under two hours to move into the last eight at the seventh time of asking.
He will face Jeremy Chardy of France after he beat German wildcard Julian Reister 7-5 6-4.
Also on Thursday, sixth-seeded German Philipp Kohlschreiber beat Fabio Fognini of Italy 7-5 6-2.
He faces top seed Nicolas Almagro of Spain, who beat veteran Russian Nikolay Davydenko 6-4 6-3.