No, the profit after all investment costs is thin and may depend on accounting, but the car production itself produces the money they are investing into e.g. the Gigafactory.
Tesla sold stock several times to fund the Gigafactory. Then they got Panasonic to pay for half of the Gigafactory.
That's not from profits, that's from shareholder investments. Its the power of the stock market to dump money into an asset. But don't pretend that Tesla managed to scrap together like $3 Billion from their years of operating losses.