Shapovalov dumped out after five-hour French Open tussle
Spanish world number 101 Carballes Baena prevailed after a five-hour battle on Court Suzanne Lenglen to set up a clash with 18th seed Grigor Dimitrov in the last 32.
Shapovalov, who reached the quarter-finals of the US Open last month, twice served for the match in the final set at 5-4 and 6-5 but was broken three times in succession.
"It's a dream for me to win a match like this on this court," said Carballes Baena, 27, after advancing to the third round of a major for the first time.
"I tried to be very solid and focus on my game. Shapovalov is very good but I did a very good match."