Tesla lost over $400 million in the second quarter despite record sales, especially of its new Model 3.

This throws Tesla's plan to become profitable by selling a high volume of Model 3 cars into doubt — and that's been the company's plan for years.

At the beginning of this year, CEO Elon Musk said the company would be profitable going forward, now Tesla says it's going to try for profitability, "although continuous volume growth, capacity expansion and cash generation will remain the main focus."

If a record volume of sales won't push Tesla into profitability, it needs a new plan that will.

Visit Business Insider's homepage for more stories.

The plan has been clear for years now.

After building the Model S and Model X, Tesla would build the highly anticipated car for the everyman, the Model 3. This proved to be difficult, though, so much so that CEO Elon Musk described the phase as "production hell."

Then Tesla had to figure out how to get those cars to the people who wanted them in a phase Musk later called "logistics hell."

Once that happened, so the story went, Tesla would swing to consistent profitability (as it did during the first two quarters after the Model 3 launched last year), and Tesla would become a "real car company." (That is to say, a car company that can make money.)

On Wednesday, Tesla's second-quarter numbers threw that entire narrative into chaos. The company suffered a net loss of $408 million as automotive gross margins fell to 19%.

This happened despite:

A record 95,356 deliveries — a 50% increase from the quarter before.

An average Model 3 selling price of $50,000.

Flat capital expenditures of $250 million for the quarter.

There's been a lot of talk about whether or not Tesla has a demand problem — you can forget that now. Numbers like these tell us that even while it's pushing as many cars out of its Fremont, California, factory as possible, Tesla is still losing money.

You know what else doesn't seem to matter with numbers like these? This (from Tesla's letter):

In Q2, Model 3 deliveries reached an all-time record of 77,634. Not only was Model 3 once again the best-selling premium vehicle in the US, outselling all of its gas-powered equivalents combined, this product also gained traction in other markets.

In Europe, Model 3 is approaching sales levels of established premium competitors. As we stated previously, more than 60% of Model 3 trade-ins are non-premium brands, indicating a larger total addressable market for this product than initially expected.

It doesn't matter how many "premium" cars you can sell if you lose money selling them. Last quarter, Tesla Chief Financial Officer Zachary Kirkhorn touted the $50,000 average selling price as something that should give investors a sense of relief. These second-quarter numbers show us that that is not the case. The price needs to be higher, or we need a lot more of Tesla's aging luxury models in the mix.

And, for what it's worth, the Model 3 was never supposed to be a "premium" car. When Tesla first introduced the idea of the car, it was supposed to be affordable for everyone, a $35,000 car. Now that model barely exists, and with these numbers, you have to wonder — will it ever?

Read more: One of Tesla's biggest bulls just turned around and trashed the company on a private call with Wall Street

After Tesla eeked out a profit in the third and fourth quarters of last year, Musk said the company would be profitable going forward.

But when I asked a spokesperson how Tesla planned to do that with numbers like these, they pointed me to this sentence in its investor letter: "Tesla continues to aim for positive GAAP net income in Q3 and the following quarters, although continuous volume growth, capacity expansion and cash generation will remain the main focus."

It's unclear how Tesla's next car will change this scenario. It plans to start selling the Model Y, a crossover SUV version of the Model 3, in fall 2020. It will have pricing dynamics similar to the Model 3, but what Tesla really needs is a luxury car with fatter margins.

The one bright spot in all of this is that Tesla has $5 billion in cash. The way that it burns cash (around $2 billion a year), and considering that it needs to pay down debt (it has a $566 million bill to pay in November), that $5 billion should give it a year and change to figure out how to get out of this jam.

That said, the idea that Tesla can build a car for the everyman at high volumes and become a "real" (profitable) car company may very well be dead.