Chosen Solution

I bought a Samsung Galaxy Z flip and it’s locked on sprint and I was wondering if it’s possible to swap the logic board that’s unlocked so that I can use it for Tmobile?

yeah that will work fine. look at a repair guide here on how to do so. make sure you dont rip any cables as parts for the flip are pricey