iPhones are not really expensive compared to high-end Android phones like Samsung S series. Same price pretty much. However, iPhones always keep their prices much better. Tons of people are interested in buying iPhones on the used market, so price is way higher. Also, Apple keeps their pricing steady. Android phones gets cheaper and cheaper till they go EoL and gets replaced, this means that your old Android phone often is worth peanuts after 2 years.
Had 4 iPhones, zero issues on any of them, both hard- and software. The small software issues I have had, was all fixed very fast.