Google (now under parent company Alphabet) invested roughly $900 million as the majority of a ~$1 billion funding round alongside Fidelity Investments. This gave Google an initial equity stake of about 7–7.5% in SpaceX at a valuation of roughly $10–12 billion.
Sure, I'm cherrypicking the success stories but I don't think it's the only signal people should use.
By traditional business metrics it looks toxic but compared to a typical tech unicorn it's not really outstanding.
Considering it's a tech unicorn with strategic and financial leverage like no other (their own global Internet infrastructure, access to arbitrary billions in capital, ability to build the biggest chip fab in the world), it's certainly fair to call it a gamble, but to call it failing is a stretch imo.