Tesla Inc. doesn't have a "production hell," to use CEO Elon Musk's own words. What it has is an "earnings hell."

It turns out the real problem facing Tesla isn't that it can't produce and deliver enough of its hugely popular electric vehicles (EVs) to eager customers worldwide. It actually set record highs in both categories in the second quarter.

Tesla's real problem is it can't seem to make money despite these records, and it posted record losses in its financials for the second quarter and the first half of the year as a whole. The company lost $408 million in Q2, according to a new filing with the Securities and Exchange Commission.

While it looks huge on its face, this amount is 42 percent lower than the huge $702 million loss Tesla posted in the first quarter. This means that for the first six months of 2019, Tesla has accumulated losses of $1.1 billion. About $117 million of this loss was put down to restructuring charges related to layoffs and showroom closings.

What this massive loss tells analysts is Tesla isn't doing a good enough job of selling the masses of EVs it's producing, especially the Model 3 luxury executive sedan, its most successful vehicle. There's also no denying that sales of the Model S and Model X have largely stagnated.

"There's probably a bit too much focus on (Models)S and X," said Musk in a call with analysts. "But the story for Tesla in the future is, fundamentally, the Model 3 and Model Y."

Tesla upgraded both the Model S and Model X in April to keep it salesworthy. The upgrades came from tech already installed in the Model 3 that dramatically increased overall range and improved charging speeds. There will, however, be no full refresh of the Model S, 3 and X, asserted Musk. This move would be much too expensive.

"There may be a false expectation in the market that there's, like, some big overhaul coming for S and X which then, you know, could cause people to hesitate to buy if they think there's like some radical redesign coming, which is why I emphasized publicly that this is not the case," said Musk.

"The Model S and X today are radically better than the ones that when we first started production, especially the S. Like, a 2013 or 2012 Model S, compared to today's Model S -- it's night and day."

On the other hand, Q2 saw Tesla reap $6.3 billion in revenue, and $5 billion in cash. Tesla said this cash flow is the "highest level in Tesla's history." This was due largely to a $2.7 billion capital infusion in May.

"We believe our business has grown to the point of being self-funding," said Tesla in a statement.

Tesla reaffirmed its full-year delivery guidance despite these discouraging financials. It still expects to sell anywhere from 360,000 to 400,000 vehicles this year. Most of these will be the Model 3.

In Q2, Tesla reported record production of 87,048 EVs and record deliveries of 95,356 EVs, surpassing its previous quarterly records of 86,600 EVs produced and about 91,000 EV deliveries set in Q4 2018. It described these achievements as "an important milestone as it represents rapid progress in managing global logistics and delivery operations at higher volumes."

Tesla said it generated $614 million of free cash flow (operating cash flow less capital expenditures) in Q2. Combined with its public offering of equity and convertible bonds (with net proceeds of $2.4 billion), Tesla ended Q2 with $5.0 billion in cash and cash equivalents, the highest level in its history.