Tesla's stock has cratered after posting a big second-quarter loss, despite word that revenue, production and deliveries all had hit all-time records.

Tesla has a history of riding a roller coaster when it comes to its stock price, and sharp downturns have frequently been followed by equally aggressive surges. But despite an upbeat forecast by CEO Elon Musk for the second half of 2019, the battery-carmaker appears to be facing far more serious scrutiny going forward.

For his part, Musk tried to put a positive spin on its $408 million second-quarter net loss, telling reporters and analysts on a conference call that, "We expect to be breakeven this (third) quarter and profitable next quarter," while also promising that Tesla will "be cash flow positive going forward, with the exception of quarters when we introduce a new product."

There are a number of new products coming, including the Model Y sport utility vehicle, a second-generation Roadster, an all-electric pickup and a battery-powered semi-truck. But the question is whether those really can deliver not only the revenue, but the margins that analysts and investors are expecting.

Clearly, the second quarter wasn't all bad. It produced a record 87,048 electric vehicles during the three-month run, while delivering an all-time-high 95,356. Yet it still managed to lose money.

"Tesla hitting a sales record is not a surprise considering shoppers were scrambling to take advantage of the waning tax credit," said Jessica Caldwell, the chief analyst with auto tracking service Edmunds.

Until Jan. 1, 2019, buyers could expect to receive a $7,500 federal credit, but after that date it was halved to $3,750. Then halved again beginning on July 1 through the end of the year to $1,875. The lower tax credits could weaken demand during the coming months, and it will be eliminated entirely on the first of next year.

"Also, Tesla may have a reputation as an innovator but to boost sales they stole a page from the traditional automaker playbook by lowering prices and making buying easier with a leasing program," Caldwell said. Both moves together work against the big jump in margins that Musk has repeatedly promised.