Whittaker has a hernia that requires urgent surgery.
Whittaker's withdrawal has thrown a spanner in the works for UFC president Dana White, who was banking on the winners of the main and co-main events to square off later this year.
Fighting out of Sydney, Whittaker is the UFC's first titleholder from Australia.
Gastelum will not remain on the card, with Israel Adesanya vs Anderson Silva elevated to the main event slot (still as a three-round fight) at Rod Laver Arena.
US Senator Elizabeth Warren Formally Launches 2020 Presidential Campaign
As supporters cheered and clapped, she also said on Saturday, "I'm opting out ..." Warren would enter the race as one of the party's most recognizable figures.
On Saturday, Whittaker and Gastelum both made weight, with "The Reaper" coming in at 185-pounds and the American challenger at 184-pounds.
Silva, 43, broke into tears during the UFC 234 official weigh-in. Whittaker won a brutal split decision - his second win over Romero in a year.
The bout will determine the next contender to the title, likely after Whittaker defends vs. Gastelum.
If not Sonnen, then perhaps a fighter closer to home?