You're supposed to include capital expenses and depreciation in margins. Just because they're building factories doesn't mean they have higher margins.
This is why startups underestimate their expenses.
The new factory isn't part of the current production cars Cost of Goods Sold because it isn't being used yet. See the matching principle. The depreciation of the factory will absolutely factor into the COGS of the cars it produces in the future, but the increase in sales volume should compensate for that.