For decades there has been endless policy wrangling over whether “unlocking your phone” (removing restrictions allowing you to take the device with you to another carrier) should be allowed. Giant carriers have generally supported onerous phone locks because it hampers competition by making it harder to switch providers. Consumer rights groups and the public broadly support unlocked devices.
It’s only a thing if you are on some form of lease plan where you don’t own it outright. Pretty much every carrier in the US sells phones on a monthly payment for the device, which usually is just the cost of the device spread over 30 months, etc. While the device is still not paid off its carrier locked. After its paid off you need to jump through a few hoops but it’s honestly not too hard. I’m not sure what the FCC is hoping to accomplish here, it’s a similar arrangement to leasing/financing a vehicle, where the dealership holds the title till it’s bought/paid off.
There are cases other than what you mentioned where the carrier refuses to unlock. During 2021, AT&T forced a phase out of 3G and provided allowed customers to get a free upgrade phone in the process. As a prepay customer, I took the phone but jumped ship to a different carrier. I tried to get them to unlock the phone earlier this year and they refused. There was no contract/lease involved, but they didn’t like that I didn’t remain a customer with them for (I think it was) 180 days after that.