Carriers have a simple and understandable reason for locking phones. If they let you snag a phone at a discounted price, they want you to stay with them for a predetermined period. That doesn’t make carrier locks any less annoying though.
Some Samsung users have discovered that their phones can be unlocked easily, even if the devices have not been paid off. All you have to do is go to the Settings app, tap on Connections, navigate to More Connection Settings, and then open Network Unlock. After that, you should ask for a Temporary Unlock, and after a short wait, tap on Permanent Unlock, and ta-da, your phone will be unlocked.
After all, consumers have been able to unlock phones on their own since at least August, so it seems unlikely that T-Mobile is not aware of this loophole. That said, even though this sounds intentional, since there is no official confirmation, you should go this route at your own risk.
One floating theory is that Samsung’s One UI software has a bug that auto-approve unlocks if a device is on T-Mobile.