They want to see the IMEI of the leased/ETF phone on your final bill. If the IMEI does not match up with what you return then no payout.
My understanding is that there used to be a way around this, but they closed the loophole before I joined.
Now, if you get JOD, you can dodge the lease fees. You just jump to the cheapest JOD device you can, then do not sign the lease. Return the device in store. You're out the re-stock fee but that's nothing compared to the lease charges. If you have a spare phone at that point you can put your SIM in it.
Oh. If you do return phones, try to get them to take it in store. I love T-Mobile but I learned right away not to trust their return service. They tend to lose the phones returned to them because they have a very crappy return system and you the customer are out a phone/credits or stuck with paying lease fees because they never scanned the phone in.
Somewhere in T-Mob's vast warehouse is an unlocked Sprint iPhone 6+ 128GB Space Gray that never got scanned in. Luckily I was able to get my credit for it out of them.