Well it's not the cost of adding the hardware (which is, yes, so cheap to be practically free), it's the engineering challenge of the internal layout and fitting in a sizable battery. Basically, with thin phones you rarely get a battery that actually is a flat square pad that fills the whole back, it's more shaped to fill in the voids between components. There's actually a lot that goes into that aspect, and as all flagship models have become thin, and that's what is selling, thin with displays that take up the entire front face, this is what we're stuck with. It was the thinness itself at first but even with phones getting a little thicker again it's now the screen and squeezing in other components at the top and bottom and antenna placement that has made extra features actually a negative to add, unless you want a tiny battery and everyone would complain about that too.
I've watched a few videos explaining the internal engineering process which drives these decisions and it's quite informative. It is truly the engineering that has driven this and not some business complaint about manufacturing costs. Battery and antennas have largely been the driving force, optimizing those and scrapping what impedes that -- it's largely been the bet that more users would complain (and sales would drop) if they scrimped on battery and antennas versus if they just get rid of external features like headphone jack and SD card reader, and is a main reason why eSIM is becoming the new thing versus external SIM card slots.