The distances
Measured between published coordinates: Cancún to Mexico City is about 1,295 kilometres, Mexico City to Oaxaca 366, and Oaxaca back to Cancún 1,133. That is a loop of roughly 2,794 kilometres, all of it flown, because there is no national passenger railway and the road alternatives are two days each.
Route aggregators publish the nonstop Mexico City to Cancún leg at somewhere between about two and a half and three hours in the air, and Mexico City to Oaxaca at around an hour, though schedules change and you should check the current ones. The flying is not the problem.
Where the four days go
The problem is the days around the flying. Each move takes a checkout, a transfer to the airport, the airport itself, the flight, the transfer at the other end and a check-in — and it lands in the middle of the day, so it eats both ends of it. Three moves in nine days is three days gone, plus the arrival day and the departure day, which are half days at best.
What is left is about four usable days spread across three cities, none of which gets a second full day. Meanwhile you have crossed into Quintana Roo, which has been an hour ahead of the rest of the country since 2015, and back out of it. Do any two of the three instead and the same nine days turn into a trip.