The MotoGP™ championship leader has now been demoted to sixth place as a result.
Quartararo was aiming to seal back-to-back wins in Barcelona following his triumph on the circuit in 2020, but the Monster Energy Yahama driver slipped up early on and failed to finish on the podium.
Quartararo was second until the final three laps when Zarco made a daring overtake and caught the Frenchman out.
To complicate matters, Quartararo's suit had opened, causing the 22-year-old to remove his chest protector.
He cut two corners as he battled with Miller for third, and was handed a three-second penalty which cost him a third straight podium position at the Catalan Grand Prix.
"What happened I don’t know, I just know that I had the leathers completely open," he explained to reporters.
"I tried to just put it in a normal position again, I couldn't do it. So was difficult to ride, but unfortunately, it happens.
"It happened today, so Alpinestars is looking at how it's possible because at the end of the race it was possible to close it again.
It was a race that belonged to Oliveira, with the Portuguese rider holding the lead for 23 laps.
"The most difficult thing about the race was the mental ability to stay calm, it was so easy to be aggressive or to just override the tires at the beginning," he said in a news conference.
"I felt like that was the key, stay calm and the race will come to me."
Marquez has now failed to finish the last three races, a career first for the 28-year-old.