It’s possible you will get better TCO by spending more upfront if you intend to keep the phone while it is still “current” and receiving OS updates - some quick calculations below based on phones mentioned in another comment (happy to be corrected if the info is wrong).
The pixel 4a has “No guaranteed Android version updates after August 2023” according to google. $350 / 3 = $116/year.
iPhone 11 is $699 according to google. Let’s assume 5 years of support which is reasonable for Apple at this point which = $139.80/year.
Galaxy S8 seems to have been released 3 years ago and only has android 9.0. So let’s call that 3 years (might be less since I don’t know when the last update landed). Assuming the same for the $900 S10 = $300/year.
Note that I am told some phones have advertisements built in and also some manufacturers are also selling your data but not sure how to cost this in (and some people don’t care).