ELON MUSK, a mercurial entrepreneur, wants to take Tesla, his electric-car firm, private. That will cost billions. Where will he find the money? On August 13th Mr Musk gave an answer: from Saudi Arabia, probably (see Schumpeter). It is a common refrain. When visionaries want someone rich to back something bold, they turn to Muhammad bin Salman, the crown prince who runs the oil-rich kingdom. He has committed $45bn to a Japanese tech fund and plans to build an ultramodern city on the Red Sea costing $500bn. If Prince Muhammad wants to invest in electric cars too, why not take his cash?

One reason for caution is that what the prince gives, he can suddenly take away. This month, after Canada’s foreign minister tweeted that Saudi Arabia should not lock up peaceful dissidents—hardly an unusual statement for a Canadian politician—Prince Muhammad was furious. Instead of ignoring the tweet, he retaliated wildly. Saudi Arabia expelled the Canadian ambassador, cut off bilateral trade, ordered Saudi students out of Canadian universities and told sick Saudis to shun Canadian clinics. State media lambasted Canada’s human-rights record; social media portrayed Canada as a drug-addled dystopia. Mr Musk, who is half-Canadian, has been warned.

Prince Muhammad’s fury will not hurt Canada much. Just 0.2% of its exports went to Saudi Arabia last year. The immediate pain will be felt by Saudi students who must suddenly find another college and Saudi patients who must take their ailments elsewhere. In the longer run, the main damage is to Saudi Arabia’s reputation—and that has real consequences.

Investors like predictability. Prince Muhammad offers the opposite. Last year, without warning, Saudi Arabia led an economic blockade of Qatar that continues to disrupt trade in the region. Months later, as part of an anti-corruption drive, hundreds of Saudi princes and tycoons were locked up in a luxury hotel in Riyadh until they surrendered a big chunk of their assets. No doubt some of them were guilty of something, but there was no due process. To outsiders, it looked as if property rights in Saudi Arabia depend on the prince’s whim.

In many ways, Prince Muhammad is trying to change the kingdom for the better. He has loosened religious and social restrictions: Saudi women can now drive, and everyone can go to the cinema. He has pursued economic reforms aimed at eventually weaning the Saudi economy off oil, and encourages Saudi women to go out to work. All this has made him popular, especially among the young and among women.

A reformer, but reckless

Yet by doing things that are wrong and foolish, he needlessly alienates potential supporters at home. Even as he lifted the ban on women drivers, for example, he was locking up women who had campaigned for it. He needlessly alienates foreigners, too. Last year the Saudi authorities detained Lebanon’s prime minister for two weeks—an extraordinary breach of diplomatic norms. In Yemen, where Prince Muhammad is fighting a proxy war against Iran, Saudi bombs hit a school bus on August 9th, killing dozens of children. The war, now in its fourth year, has devastated Yemen and shamed allies such as America and Britain, which supply Saudi Arabia with arms.

Few Saudis are brave enough to tell Prince Muhammad when he is making mistakes. His allies ought to speak up, but they are silent too. This is a grave mistake. Saudi Arabia is the largest Arab economy and home to Islam’s holiest sites. Successful reform there would help stabilise the whole Middle East. Foreign leaders should advise Prince Muhammad to calm down and stop damaging his country and his reputation. If he does not, they should stop selling him weapons.