Caveats before I go further:
- This probably just voided the warranty on a $400 device
- It's possible that firmware updates or other processes could make this stop working at any time. The IMEI is an identifier on the modem's memory, not the Unifi memory.
- Modification of IMEI may not be legal where you live. You should do your own research before going further.
- If you are doing all of this work you should probably just look at DIY-ing with an M.2 RM551E or similar and a PoE adapter...
- It is entirely possible (and likely) that T-Mobile (already) recognizes this activity for what it is and may take action against your account. IMEI is far from the only metric that networks have for profiling their clients. For what it's worth though, there are a good number of reports of people using 3rd party modems on TMHI for many years now with no issues. YMMV and that can change at any time.