Are all iPhones the same across carriers now? I know that several years ago, some iPhones had CDMA and others GSM, and others yet had both, depending on which carrier the phones were meant to work with.

But I read somewhere that nowadays, all of them come with extensive network compatibility. AT&amp;T told me that their phones are locked but can be unlocked once fully paid off. So it sounds like there is a software lock but perhaps the hardware is universal.

I am looking to buy a T-Mobile phone, get it unlocked, and then switch immediately to using another carrier.

Are all iPhones the same now, in terms of communication hardware/software?
No. In the US, CDMA models can work on GSM but the other way, not so much.

Worse, in the US, Sprint and Verizon are not willing to bring aboard a device from the other carrier despite CDMA and GSM potentially being technically compatible.

The GSM phones when unlocked work across pretty much any GSM carrier.
The CDMA phones when unlocked also work across pretty much any GSM carrier or the specific carrier that the device was assigned to initially. (So I would generally be able to bring a Verizon iPhone from another person to my Verizon account)