Exactly this! As someone who owns a Sony Xperia 1 VI, it's worth pointing out too that Sony managed to achieve this level of waterproof with a tool-less SIM/SD card tray too, which you can simply pull out the card tray with your finger, without having to use a pin. Sony likely chose this design because they wanted to market the Xperia phones to photography enthusiasts (as can be seen in their marketing), so they wanted make it quick and simple to swap the SD card between the phone and a PC for transferring photos, like when you're using a proper DLSR camera. And they've been using this tool-less tray design since the 2nd gen model that came out 6 years ago, it's a proven reliable design.
So yeah waterproofing a phone really wasn't as hard as some of those manufecturers tried to suggest.
There are many other companies who made waterproof phones with replaceable battery too with good IP rating.it was never a technology problem.