Federer had been hoping to get his claycourt form back in gear after skipping last week's Madrid Open to attend the birth of his twin boys Leo and Lenny but the winner of a record 17 grand slam titles will now be flying back home to his family.
Fourth seed Federer made a promising start but, with dust whipping up off the surface and the ball playing tricks, Chardy fought back with some brutal forehand winners and saved match point in the tiebreak before sealing victory.
World number one Rafael Nadal laboured into the third round with an energy-sapping 7-6(1) 6-7(4) 6-2 victory over dangerous Frenchman Gilles Simon.
The 13-times grand slam winner has endured a slow start to the season, winning just three titles and suffering a number of uncharacteristic losses on his favoured clay surface.
He won the Madrid Open on Sunday after his final opponent Kei Nishikori of Japan was forced to retire through injury having been on the brink of victory and Nadal was forced to endure another scare by Simon.
The 29-year-old forced Nadal into a tiebreak in the opening set but the Spaniard gained the impetus and his heavy groundstrokes gave him the lead.
In the second set Simon, a former world number six, survived an early break, match point, and a brief interruption by an errant pigeon before forcing a deciding set with a series of powerful forehands.
Nadal, the 'King of Clay', coped best in a draining final set and from 2-2 won four games in a row to claim victory but doubts remained about his form ahead of his bid for a record-extending ninth French Open title starting later this month.
"It was a tough moment in the second set, but this was the first match on clay where I had to suffer, mentally and physically," Nadal told www.atpworldtour.com.
"I was not playing bad and I am happy to have dealt with that kind of anxiety.
"I look forward to playing the third set because these are the matches that give me more satisfaction, the ones that test you very deeply. I did it and I am very happy."
Andy Murray made light of the swirling winds to ease past Spain's Marcel Granollers 6-2 7-5.
The seventh-seeded Briton proved far too solid for his unseeded rival as he set up a third-round clash with Austrian veteran Juergen Melzer.
Murray reeled off four games in a row from 2-2 in the opening set and, apart from losing his opening service game in the second set, he always looked in control.
While not being forced to play his best tennis, it was an impressive opening for Murray, who a year ago at the same tournament retired with a back injury against the same opponent.
"All the dust and stuff was getting in your eyes. It was extremely blustery, strong conditions," Murray, who is looking to get in some match-time for the French Open, told Sky Sports.
"From one of the ends it was really tough to get any real depth on the ball. I just tried to play a smart match."
Melzer beat Croatia's Marin Cilic in the three sets and sixth seed Tomas Berdych saw off Dimitry Tursunov 6-4 6-3.
Women's top seed Serena Williams showed no signs of the thigh injury that had threatened her participation in the tournament with a routine 6-2 6-2 win over Germany's Andrea Petkovic.
She will be joined in the third round by Russia's Maria Sharapova who beat Monica Puig 6-3 7-5 to record her 12th win from 12 matches on clay in 2014.