I don't see how that could be true. There are a bunch of people, and always have been, who are using unlocked branded devices on other carriers, not to mention the unbranded devices.
My educated guess is this is under the control of service books. You might, before you go to the trouble of reinstalling the OS, go into settings and look at service books. Delete any that have an email address as part of the name or title, and certainly delete any AT&T service books you mighty find. Then do a battery pull and make sure you are in a location that you know has good signal when you put the battery back.
Also, I don't know if APN matters here or not. But check and verify your device is set to the T-Mobile APN. As I say, not sure it matters, but worth the little trouble to check.