The Samsung S5 is rated IP67, resistant to 1 meter of water for 30 minutes. The iPhone 11 Pro is rated IP68, resistant to 4 meters of water for 30 minutes.
Also, this entire argument feels like it's getting way too much significance. It's definitely doable, even with IP68, there are tons of replaceable-battery-operated waterproof devices out there, this shouldn't be a reason.
Buyers would also rather keep the solid slab with no hatch form factor, than see the phone be 2mm thicker I assume. A lot of other devices don't have a size budget that is as extreme as a modern smartphone.
Put the other way: a slightly bigger phone (because of some separating compartment, gaskets, battery in a plastic cartridge and so on) could instead have been a solid slab with a slightly larger battery, so several hours extra battery time or higher performance at the same battery time.