Corentin Moutet beat the 2015 champion 2-6 6-3 7-6 (7-2) 6-3. He earned the dubious reward of a second round meeting with 13-time champion Rafael Nadal, who beat Australia's Jordan Thompson 6-2 6-2 6-2.
Wawrinka, at 14 years older than his 23-year-old opponent, had previously played only four tour-level matches this season, winning two. He missed most of last season after having surgery on his left foot.
"Unfortunately this is the reality of how I play at the moment. I need training, a lot of work. I am playing well but not at the level for matches like that. This is the reality unfortunately of where I am," the Swiss said.
"The frustration does not come from a comparison of my past level but because I know I could have done more and that some things did not go well," Wawrinka added.
Moutet, world No.139, had lost six of his last nine matches.
Elsewhere British No.2 Dan Evans finally won a match at Roland Garros at the fifth time of asking.
A first-round loser in each of his four previous main draw appearances Evans marked his 32nd birthday by beating Argentina's Francisco Cerundolo 7-6 (7-3) 6-4 6-4.
Evans, a big golf fan, revealed he had stayed up too late the night before watching the US PGA Championship, although he was forced to turn in before Justin Thomas completed his dramatic win.
"My missus was hassling me to sleep," he said. "I wanted to watch some more, but I was up early. I couldn't believe it when I read it in the morning. I basically missed one of the best endings ever. So it was a little annoying, but I'll take the win."
American 18th-seed Reilly Opelka lost to Filip Krajnovic in straight sets.
With agencies