Seen from above, the mountainous national park directly above Tham Luang Nang Non, the Great Cave of the Sleeping Lady, appears tranquil — like someone lying on their side, if they were furred with trees and ran the along much of the length of Thailand’s border with Myanmar. It hardly seems like the site of a two-week-long, 10,000-person rescue operation that would pit the resolve of at least one government against the near-constant rain of the country’s monsoon season, in a contest to save the Wild Boars, a local boys soccer team. It’s unlikelier still as a battleground for international public opinion about Elon Musk, the billionaire founder of Tesla, which produces luxury electric cars, and SpaceX, which stages private rocket flights for the American government.

Nevertheless, it was. Two weeks ago, a week into the world watching rescue efforts progress, Musk announced he would step in to help. He’d ordered his engineers at SpaceX and the Boring Company, which aims to use tunnels burrowed under cities to clear traffic on the streets above, to head to Thailand to see if they could find a way to get the kids out. The engineers decided to repurpose a liquid oxygen transfer tube from one of SpaceX’s rockets as a child-sized submarine, eventually simulating a cave rescue with divers in a pool in Los Angeles. The sub — which Musk named Wild Boar, after the soccer team — eventually made it to Thailand near the end of the rescue effort.

Just returned from Cave 3. Mini-sub is ready if needed. It is made of rocket parts & named Wild Boar after kids’ soccer team. Leaving here in case it may be useful in the future. Thailand is so beautiful. pic.twitter.com/EHNh8ydaTT — Elon Musk (@elonmusk) July 9, 2018

Not everyone was satisfied with Musk’s efforts. Vern Unsworth, a veteran British cave diver who helped with the rescue, called the sub a “PR stunt” and said that Musk could “stick his submarine where it hurts” in an interview. (As The New York Times noted, Thai officials had previously called Musk’s submarine impractical for the rescue mission.) Musk, in a state of overwork — the rescue mission began just after Tesla’s sprint to produce 5,000 Model 3s in one week ended — did not take kindly to Unsworth’s words, retorting with a series of angry tweets. In them, he called Unsworth “a pedo guy,” among other things; they’ve since been deleted, and Musk offered a half-hearted apology, in a reply to an unrelated Twitter user, after Tesla’s stock tumbled by 3 percent.

The incident has not shaken the faith of his devoted fandom

But the incident has not shaken the faith of his devoted fandom, which has come out in droves to support him. On Tuesday, Musk retweeted a fan who declared that “journalism is dead” and linked to a Quora post that defended Musk at length, both for his involvement in the rescue mission and his now-infamous “pedo” tweet. Similar defenses were mounted by other fans and friends of Musk, including Bonnie Norman, an early Tesla investor and Musk acquaintance who posted a thread on Twitter defending the CEO. “You don’t get to attack someone repeatedly & then clutch your pearls while reaching for your smelling salts when your target finally reacts. You’re a bully,” she wrote. “I have watched for over a week as mob mentality has taken over. Evidence that Elon’s help was welcomed? Ignored. More evidence? Ignored. But a British diver says Elon can ‘stick his submarine where it hurts’ & it’s a mob feeding frenzy.”

I got in touch with some people I’d spoken to for a previous story about the billionaire’s fandom to hear what they had to say. Musician Jim Ocean, the composer of a laudatory song called “The Future Smells Like Elon Musk,” was also dismissive of the criticisms of Musk. “I think Musk was being sarcastic with the ‘pedo’ remark. It was a dumb thing to say,” Ocean wrote to me in an email. “Elon Musk is bound to make mistakes... He’s not a perfect human being, but he does know how to inspire people and get things done. Maybe he’s pushing too hard cause he’s getting blowback. Can you think of anyone else that’s doing as much as he is to embrace the future and help bring the human race forward?”

IT specialist and Musk fan Corey Brundige condemned the “pedo” tweet — “I found [it] to be absolutely abhorrent,” he wrote — and said that he would like Musk to seek professional help. Even so, he also pointed out that Musk’s tweets would have little impact on his companies. “Short-term, there may be some blowback, but ultimately the advances being made, perceived or real, are a high that both investors and tech-enthusiasts aren’t willing to give up. Elon and his companies can generate good (or at least more interesting) press when the other is being hammered by ill will.”

Whatever missteps he makes are overshadowed by his optimistic promises of bettering the world

Fans love him for his gestures, his apparent willingness to try and better the planet. Whatever missteps he makes are overshadowed by his optimistic promises of bettering the world. The fact that Musk dropped everything to attempt to help a soccer team stuck in a flooded cave on the other side of the planet comes off as heroic. What other billionaire would leave his company after one of its most successful (and stressful) weeks, and then use his expertise to design a solution to the problem (even if that solution was immediately deemed unworkable)? Only Musk. That’s part of his aesthetic as a leader (to fans) and a figurehead (to investors).

Ultimately, investors haven’t been deterred either, despite his long line of digital missteps. Even in the last few months, Musk’s tweets and online antics have gotten him into similar public relations trouble. Famed short-seller Jim Chanos, who’s been shorting Tesla for years, recently spoke to CNBC about how Musk had attacked him on Twitter, claiming that Chanos had bribed a journalist for inside information on Musk’s company. “We talk to journalists all the time. We have never received insider information from any journalist at any time, including Tesla,” said Chanos. “These are serious charges,” he said. “When you make serious charges, you ought to bring serious evidence.”

There was also the time he joked about Tesla going bankrupt in April, which sent stocks falling by 5.16 percent. The next month, on a bizarre May 2nd investor call, Musk decided to take questions from a YouTuber. The stock opened at $278.79 the next morning — a 7.4 percent drop from its close the day before.

On its face, this seems worrying, and critics took note of his erratic behavior. “Over the last 6 months, there have been too many examples of concerning behavior that is shaking investor confidence,” wrote the venture capitalist Gene Munster, who does not own shares in Tesla, in an open letter published on July 17th. “In our view, your outburst at analysts on the March 2018 earnings call, your ongoing frustration with short sellers and the media, your June email exchange with the saboteur, and your confrontation on Twitter with cave diver Vern Unsworth each raised flags with investors.” Munster was firm about what it would mean for Tesla if Musk failed to control himself online. “Your behavior is fueling an unhelpful perception of your leadership — thin-skinned and short-tempered.”

The stock bounced back anyway. Musk called Unsworth a pedophile on July 15th, a Sunday; by 1:45PM ET the following Tuesday, before his apology the next day, Tesla stock was trading at $324.10 per share, higher than it had been before Musk’s comments. There’s a pattern. Tesla stock dips and then shoots back up after Elon convinces investors that they haven’t made a mistake for believing in him. And while his behavior may have left some investors unnerved, it hasn’t done any permanent damage to his companies — at least so far.

The stock bounced back anyway

The series of incidents hasn’t deterred him from tweeting, either. According to Twitter data gathered on Musk’s account, the number of times he’s tweeted has been steadily increasing since at least September of last year. Last July, Elon Musk had 10.81 million followers on Twitter. A year later, he’s more than doubled that to 22.3 million. He’s also been tweeting more; this June, he tweeted 86 times, or nearly three times per day.

Part of the problem is that Musk’s tweets weren’t, until recently, a problem. Musk is a charismatic leader, and his visibility, combined with his willingness to mix it up online, has pushed Tesla’s valuation to its current eye-popping $54 billion — despite that the company has never turned a yearly profit. Tesla investors and fans alike believe in the promise of a dreamer who’s nevertheless managed to do, via his companies, a lot of what he’s set out to.

But it seems that even Musk realizes that his inflammatory tweets aren’t always the wisest course of action. In a recent interview with Businessweek, the Tesla CEO told a reporter about his Twitter philosophy. “If you’re on Twitter, you’re in the arena,” Musk said. “And so essentially if you attack me, it is therefore OK for me to attack back. Is there a place where you think I launched an attack on someone who has never attacked me?” And then: “So the question is: If somebody attacks you on Twitter, should you say nothing? Probably the answer in some cases is yes, I should say nothing. In fact, most of the time I do say nothing. I should probably say nothing more often.” A little over a week later, he tweeted at Unsworth.

The Wild Boars were eventually rescued after a grueling effort that claimed the life of one Thai Navy SEAL. In their first public appearance since their escape, the boys, all aged between 11 and 17, were joyous. They took pre-screened questions from the assembled media; one person asked about the lessons they’d learned from their ordeal. Ake, their coach, replied that he was going to live more carefully. Ardun, the stateless 14-year-old who coordinated with the team’s rescuers because he was the only one who spoke English, said the experience had taught him the consequences of acting carelessly. For now, at least, it’s a lesson that Musk has no apparent reason — or willingness — to learn.

Update 7/19/18 5:15 ET: A previous version of this article stated that Tesla had never turned a profit. It has never turned a yearly profit. The article also stated had hit its goal of producing 5,000 Model 3s in a month, instead of in a week.