Roger Federer lost his first clay-court match in almost two years as Spain's Pablo Andujar fought back to win the deciding third set in Geneva.
The 39-year-old Swiss, playing for the first time since losing in Doha in March, was beaten 6-4 4-6 6-4.
Federer, a 20-time Grand Slam champion, led 4-2 in the third set, only for Andujar to win the final four games.
"I expect better from myself. Matches are a different animal so I've got my work cut out there," said Federer.
"I feel like in practice I've been playing better.
"It's good to be back on the court but then you lose a match like this and you're down. It never feels great."
Federer was playing only his second tournament since January 2020 after two knee operations. On his return in Doha, he beat British number one Dan Evans before losing in the second round to Georgia's Nikoloz Basilashvili.
He was playing Geneva in the hope of a string of matches to prepare for the French Open, which starts on 30 May at Roland Garros.
However, the bigger focus for the eight-time Wimbledon champion is ensuring he is close to his peak for the grass-court Grand Slam at the All England Club on 28 June.
Andujar, ranked 75th in the world, is considered a clay-court specialist, having won all of his four career titles on the surface.