2017 flagship phones are expensive because of R&D, manufacturing, and profit margins. Samsung and Apple both roll some of their own silicon (Exynos + A-series). The iPhone X has a Samsung display, and I'm sure that they give them as bad of a deal as they can get away with, since they're their direct competitor. Though https://www.businesswire.com/news/home/20171108005056/en/iPh... puts the cost of the CPU at $27.50 , consider the R&D that was required to get to that part and that part cost, and the operating system, which receives continual updates for years after the device is released, which has hundreds of people working on it at Apple.
The LEGO 75192 Millennium Falcon is $800 retail and sold out everywhere. It's just plastic blocks to some people.
The reason it costs so much is because that's how much it costs to design, develop , manufacture, distribute, market, sell (Apple owns a ton of retail locations + employs many salespeople + support people that you usually get free access to), and support the hardware and software while maintaining ~20% net profit margins ( https://www.stock-analysis-on.net/NASDAQ/Company/Apple-Inc/R... ).
The fact that it exists at $1000 is impressive to me given how Samsung, LG, Sony, Motorola, HTC, etc bear much less of the cost of OS development + support. http://www.androidpolice.com/2017/11/02/android-versus-ios-s... shows where some of the extra cost of an Apple device goes.
Your points are valid but they seem to imply iPhones are priced using cost-based pricing. That is obviously not true - these phones are priced using value-based pricing, which succinctly is simply “the highest you can charge based on the value the customer gets”.