Tesla beat revenue estimates in the second quarter but missed earnings expectations as margins weakened and free cash flow turned negative. Investors remain focused on its aggressive AI and autonomous technology investments.