Presumably AT&T was the original device-subsidizing carrier and locked your device to them. (this is a common practice, and not a punitive action based on your departure to a competitor)
If so, ONLY AT&T can unlock it.
See: How to unlock your iPhone for use with a different carrier - Apple Support
I suspect that AT&T simply gave you a SIM unlock PIN (or possibly a PUK) for your previous AT&T SIM.
Unfortunately, that is NOT what you need to release a Carrier Lock.
Even if you’ve met the necessary AT&T service obligations, you might find this “difficult going” as a non-current customer.