Sometimes forcing your supply chain to pinch every penny works out the best for your shareholders.. sometimes focusing on quality products pays off more in the long run.
Time will tell.
I'm thinking about the different ways to structure a business to achieve a quality product. Is there a good example of a company that produces, in-house, an entire non-trivial (i.e. there are some systems to be integrated) product?
Other point Boeing had years long delays with the 787 partly due to developing a new technology while also trying to outsource much of their production.
No, it wouldn't. The OP asserted that Apple holds their supply chain to rigorous quality standards. You're asserting that Walmart holds their supply chain to the lowest possible pricing.
Apple earned this right by helping those suppliers get off the ground. With introduction of iMacs/iBooks (~1999) Apple helped build wireless card manufacturing plant in Taiwan from nothing ('few dusty rooms' at their modem supplier manufacturing facility). They did similar thing while shopping for Camera supplier, instead of going with someone established like Sony Apple chose Taiwanese bottom of the barrel volume suppliers (Primax/Micron) and grew their camera module divisions with each iteration of iPhone.
Apple in particular understood lomg before competitors that battery life is an extremely important real world metric. Doing their own SOC helps them optimise that.
Anyway, you are comparing the battery life of touch-based smartphones with its non-touch predecessor which isn't a fair comparison. Besides, mobile phones that could last for a week from a single charge are definitely not considered smartphones, those are feature phones.
Tesla seems to be taking the opposite approach to Apple here. In my observation, Apple drives its suppliers extremely hard to achieve the quality it requires. Tesla, on the other hand, is too eager to bring any sundry part in house (e.g. car seats). Apple's approach appears to work in that it pushes suppliers to do what's necessary. I worry that Tesla, having already bitten off a large bite to chew, is inviting too much distraction that will, in the long run, not put Tesla in a stronger position (there is a reason most automobile manufacturers outsource their seats after all).