FWIW, Porsche has trended more into the premium market lately than the luxury market, in a bid to pursue more growth at the expense of profit margin.
Gross and operating margins are pretty high in the luxury car industry, on par with iPhones. Personally, I don't think Apple would release a luxury car. I think it's more likely to partner with manufacturers of premium cars.
It might be useful to make a small number of cars within Apple, to align on their north star vision for design, to lobby manufacturers in that direction, and to build up internal knowledge of the market they'd be selling into.
But you're right, the margins on manufacturing and selling the whole vehicle would be a poor allocation of capital.
But if Apple makes a car, is it more in the premium or in the luxury market?
It seems to me that most of the bestselling Apple products are more premium than luxury, why would it be different with cars? And if not, why would they profit from margins that are usually associated with luxury cars?