Wimbledon champion Muguruza was ahead 2-1 in the deciding set against Serbia's Aleksandra Krunic in the second round of the warm-up tournament for the season's first Grand Slam event when she collapsed to the ground following a serve.
The Spanish top seed was unable to continue and handed the match to Krunic 5-7, 7-6 (7/3), 2-1.
"I felt in trouble in the second set when I was 2-0 up," Muguruza said.
Muguruza had won a tight first set and appeared heading for a straight sets win over Krunic when she opened up a 5-2 lead in the second.
More From This Section
However, she began to struggle in the 30 Celsius (86 Fahrenheit) heat and oppressive humidity as Krunic fought back to win the second set on a tiebreak.
Muguruza received treatment from the physio on court before the start of the decider and broke Krunic only to collapse while serving to consolidate the service break.
"I continued to think that with the match they might go away, and then they were increasing, increasing. And then I had a lot of my body cramping," Muguruza said.
But Muguruza was not too downhearted by having to withdraw.
"I'm pleased because we were playing very good points and, you know, good rallies," she said.
"I felt it was a good level, a good match, but I wanted to finish to see, to evaluate how the match was, but I'm happy with the way I was playing."
Krunic will now play either Sorana Cirstea or Anastasija Sevastova in the quarter-finals.
Cornet, who won her first round match when fourth seed Caroline Garcia retired injured, was too consistent for Lucic-Baroni, winning 6-1, 7-5.
In the men's draw, 21-year-old South Korean Chung Hyeon stunned fifth seed Gilles Muller from Luxembourg 6-3, 7-6 (7/1) while US qualifier Michael Mmoh upset Argentine Federico Delbonis 6-3, 6-4.