Most of the oil-rich nations have reasonably large sovereign wealth funds, so they have broad investment exposure to the rest of the global economy. I think the plan is to draw on those as necessary to transition their economies into something more diversified and sustainable.
Alternatively, the royals will just loot the sovereign wealth fund and flee the country.
Sovereign wealth funds in third-world countries don't tend to last long. Nauru would still be one if the richest countries on Earth except that the sovereign wealth fund somehow found its way into the pockets of the people tasked with looking after the sovereign wealth fund.
I also thought of Nauru. Seems the island center is chewed-up former phosphate mines and the islanders have nothing to show for it. Australia briefly (?) tried to relocate some unwanted refugees there. Not much to say for the place anymore.
And it looks (at least in Saudi Arabia's case) that they were trying to diversify towards renewables in a vast way [0], although my google search also turned up more recent articles indicating they're pushing that back [1]. The thing about the Saudi Arabian royal family is that they're all guaranteed allowances and the family grows at a near exponential rate since they all have multiple wives. I couldn't find any good sources on numbers but in a book about Saudi Arabia by former CIA operative Robert Baer "Sleeping with the Devil: How the US Sold it's Soul for Saudi Crude" [3] [4] I believe he estimated the current number to be about 60,000 (Wikipedia estimates 15,000 so I may be remembering that wrong [5]), aka an unsustainable population growth in royal family members.
Renewables are great, but I'm not sure they would be able to support an entire economy. One of the few great things about fossil fuels and specifically oil is that it is a power source that can be stored in a dense and stable form. Renewables can't really be stored in this manner and therefore can't easily be exported beyond reasonably short distances. Saudi Arabia therefore can't rely on selling renewable energy to the USA, China, and the EU to support their economy like they do with oil.
I was thinking more become a key developer of solar panels and export the panels themselves (or wind turbine blades, geothermal pipes, etc (off the cuff examples, I don't know if they have use or desire for blades or pipes)).
"A former CIA operative argues, in an article drawn form his new book, Sleeping With the Devil, that today's Saudi Arabia can't last much longer—and the social and economic fallout of its demise could be calamitous.
Five extended families in the Middle East own about 60 percent of the world's oil.
The Saud family, which rules Saudi Arabia, controls more than a third of that amount.
In the air in Riyadh and Jidda is the conviction that oil money has corrupted the ruling family beyond redemption, even as the general population has grown and gotten poorer; that the country's leaders have failed to protect fellow Muslims in Palestine and elsewhere; and that the House of Saud has let Islam be humiliated—that, in short, the country needs a radical "purification."