Wildly different cases, though. SpaceX occupies a unique and valuable space as a contractor, tesla is a consumer manufacturer being outcompeted at their own game.
Tesla is the largest EV manufacturing the world, has the best EV margin in the business and is still growing very fast for such a large company.
If that's what 'outcompeted' means, I wish my company was being 'outcompeted.
It isn't. See BYD Auto.
But that's just pedantic and even if it is true, they are still very large and successful.