Rivian Automotive Inc. late Tuesday reported quarterly results that were largely in line with expectations, with earlier, steeper stock losses narrowing as investors seemed to focus on hopes that the EV maker reaches a measure of profitability by the end of the year.