I think you miss some key aspects of this.
Yes, Tesla has clearly peaked. Even Musk realizes it. He isn't reinvesting anything into it anymore. He's paying himself more from Tesla than their annual profits, so it's clear that he knows it's gonna shrink, and he now views it as a cash cow for himself and the things he's *really" interested in. His descent into right-wing populism has pissed off at least 80% of his customer base. There are very few upper-middle-class-and-above people who worship at the feet of Trump, Tucker Carlson, Joe Rogan and Alex Jones, so they aren't gonna buy a second or third Tesla when their current one wears out. The rural and non-college-educated voters who love that stuff will buy a few Cybertrucks, but sales of those won't replace the lost revenue from losing millions of model 3 sales. Tesla is now the "cable TV" of EVs.
Twitter was never about making money. Musk wanted more control over media messaging, and he was willing to pay for it. He doesn't give a rats ass about the money he torched on the Twitter deal.
No, SpaceX is not losing NASA contracts, at least for the time being. One NASA guy grumbled about SpaceX in public and you think that means they're on the ropes? The options for getting to the moon in the next decade are a) Starship and b) there are no other options. SLS? Blue Origin? Don't make me laugh. You have no idea how slow those companies are compared to SpaceX? I'll be dead before Blue Origin or SLS lands on the moon. SpaceX put out a statement that they're going to the moon, with or without NASA, and Musk definitely has the resources to make it happen. He could write a check, twice the size of the ENTIRE NASA BUDGET, and it would barely put a dent in his wealth.
At the national level, Musk has hitched his fate to Trump. Nobody bought their little "falling out" performance. Musk is taking another massive gamble. I get it - that's what businesspeople have to do, over and over again. He's probably got the freedom to do almost anything he wants for the next 3 years. After that, the crystal ball gets fuzzy. Beyond that, I suspect his companies will start to fade. I don't care about any of his other companies, but I really hope that SpaceX avoids that fate. After Trump is gone, the Musk brand is probably gonna be pretty damn toxic, though.