Titan is not a gamble. It's a hobby. And from the eyes of a Trillion Dollar Company, it's not even an expensive one.
What's the worst that can happen? They spend a few more years on it, poaching talent from Tesla and other car companies and from internal teams, and end up with nothing. Sure, they might spend a few billion in the process, but they already did that building a spaceship, and spending at that level doesn't hurt their books at all.
iPhone on the other hand, was a huge gamble at the time. It had the potential to ruin the company by cannibalizing iPod sales, diluting the brand, and destroying morale of top engineers who were at the time the "best" employees they had.
What's the best thing that can happen? They launch the equivalent of an iPhone in the auto industry, figure out how to scale, and change the way people go from point a to b. They are recognized as the company that pulled off something Tesla couldn't, and Tim Cook / Jony Ives get to put their names on a revolutionary product that changed the world again.
So it's a low risk high return situation for them to work on it. Can they pull it off? I would say much more likely than "traditional" auto companies but less likely than Tesla. But again, it doesn't really matter to them (part of why chances of success are lower), and competition is a good thing. As a shareholder of TSLA, I don't want to see Elon Musk smoking weed on YouTube anymore. Somebody please take away his Twitter account too.