Twitter surprised Wall Street Friday when it reported a loss of $270 million in the second quarter of 2022, a period that saw billionaire Elon Musk agree to buy the social platform and then back out of the deal.