Uber stock flailed Wednesday after the company reported a surprise quarterly loss, throwing a wrench in Wall Street’s celebration of the ride-hailing firm’s move to profitability.