SpaceX has been profitable from pretty early on in its history and were until they need massive cash for the Starlink project.
Tesla is a attempting to get into a very, very capital intensive industry and during the early growth and again in 2017 they had to be less un-profitable. But the companies consistently showed that if it stopped growing it could be profitable.
The idea that it literally all there is to it is insane. Pretty much every startup is willing to make loses for growth, it happens literally all the time.
This is simply empirically wrong.