Federer had trouble handling Brands' serve and big forehands on the clay surface in the thin mountain air. The German right-hander won 6-3, 6-4 in just 65 minutes.
"I wasn't consistent enough in the end," said Federer, who failed on five break-point chances. "He was serving well and I couldn't do enough with my return."
The 31-year-old Swiss star has now lost to players ranked Nos. 116, 114 and 55 in the past month at Wimbledon; Hamburg, Germany and now in front of his home fans.
Federer's own ranking of No. 5 is his lowest in a decade since he started his run of 17 Grand Slam singles titles at Wimbledon in 2003.
Federer saved a first match point by serving an ace when trailing 5-3, and a second in the next game with a forehand winner.
Brands, who took a set off Federer in a second-round loss at Hamburg when they first played on tour, then clinched victory with a service winner.
"For sure the altitude has helped me," Brands said. "I served well and put pressure on him from the very beginning."
Defeat spoiled Federer's return to Gstaad for the first time since he won the title in 2004 — and where he debuted on the ATP Tour in 1998 as a 17-year-old ranked No. 702.
Federer only came to Gstaad and Hamburg seeking extra matches after his second-round exit at Wimbledon to Sergiy Stakhovsky of Ukraine.
After a three-week break, Federer returned in Hamburg testing a new, bigger racket but was slowed by a back injury and lost in the semifinals to left-hander Federico Delbonis of Argentina.
"I'm happy that I was able to play because I've had problems for some time now, already in Hamburg," Federer said. "But it didn't get worse during today's match."
Still, Brands extended the streak of surprise losses, breaking Federer's service to lead 4-2 in the opening set when he put away a simple overhead shot at the net.
The 26-year-old German fired down 11 aces in the match, including two to close out the first set.
Federer immediately lost serve in the second by netting a backhand volley, and had to save three break-point chances to avoid trailing 3-0.
Federer rarely loses his opening match at a tournament: Thursday's defeat ranks alongside his round-of-64 exit in straight sets at Indian Wells, California, in March 2007 to Guillermo Canas of Argentina, then ranked No. 60.
Federer is scheduled to return next month at the Montreal Masters, and then defend his Cincinnati Masters title before the U.S. Open begins Aug. 26.
Third-seeded Janko Tipsarevic of Serbia was also eliminated in straight sets Thursday, piling up the unforced errors, including six double faults, to lose to Robin Haase of the Netherlands 6-2, 6-2.
Two former Swiss Open champions advanced to the quarterfinals.
Marcel Granollers of Spain, the 2011 winner, beat Federico Delbonis of Argentina 6-2, 7-5, and 2008 champion Victor Hanescu of Romania led Roberto Bautista 7-6 (2), 3-2 when the Spaniard retired with a back injury.Suggest a correction