The oil-rich Gulf monarchy of Saudi Arabia is a money magnet for global finance.

Its sovereign wealth fund is barreling tens of billions of dollars into foreign asset managers. Its alliance with SoftBank Group Corp. is buying into startups and skyscrapers. A much-hyped listing of oil giant Saudi Aramco has London and New York at its feet. A scheme to diversify the economy away from hydrocarbons and open the doors to foreign capital will unleash a torrent of cash.

But while Wall Street investment bankers sniff deal opportunities—Citigroup Inc., for one, is trying to rebuild its local business a decade on after losing a crucial license—those taking on actual credit risk in the local economy are less enthralled.

Foreign lenders seem to be lining up to exit, not enter, Saudi Arabia. France's Credit Agricole SA is selling part of its stake in Banque Saudi Fransi, which purports to have 83 full-fledged branches and 18 "ladies' sections", to Saudi billionaire Alwaleed bin Talal for $1.5 billion. It could sell more. Royal Bank of Scotland Group Plc, meanwhile, has been trying to offload its local Alawwal unit for years. Saudi Arabia hasn't seen a big bank merger in 20 years.

That's a reflection of how what's good for capital markets—a country looking to borrow more and spend more—doesn't always mean a healthier economy. Oil prices have stagnated below $60 since 2014, crimping Saudi's state finances and its generous cradle-to-grave subsidies, and the scourge of oversupply is expected to last for years. Saudi growth will flatline this year, according to the International Monetary Fund.

The earnings of local banks fell 5 percent last year and they posted the slowest loan growth rate in five years, according to Albilad Capital. Investment bankers are being asked to fight a slump, not extend a winning streak.

Yes, Saudi Arabia is promising an ambitious reform plan spearheaded by 32-year-old Crown Prince Mohammed bin Salman. But this is a country that moves in decades, not years. The full plan's delivery is slated for 2030 and is vulnerable to toning down in the face of potential opposition from more conservative forces worried about change. The House of Saud has had its share of violent handovers in the past, with kings either murdered or forced out. MBS is taking brave, but risky, steps.

All in, it's probably sensible for a bank like Credit Agricole to put itself on track to exit its investment in OPEC's biggest producer. True, the sale would come at a cost to profit, with the French bank deriving about 8 percent of its earnings from Banque Fransi, according to Deutsche Bank. But it could also lead to a slightly more robust balance sheet and a simpler geographic footprint.

Its home economy of France outpaced Saudi's last year and will do so again this year, according to Bloomberg Intelligence. In such an environment, you could forgive bankers a dose of nostalgia for the old days when the kingdom was a closed shop that got by on petrodollars alone.

This column does not necessarily reflect the opinion of Bloomberg LP and its owners.

    Read more: www.bloomberg.com