The company reported a loss of $5.9 million, compared to a profit of $54.7 million in the second quarter of 2018.