If its the AT&T version (presumably, since this is the AT&T variant section) it should carrier locked, unless you obtained the unlock code; or otherwise purchased it SIM unlocked from a 3rd party vendor.
On the other hand, if you were able to connect to the network at all, it is probably not carrier locked. Likewise, if it was locked, it would ask for the code when you inserted the SIM.
I think something else is going on. Even if it as SIM locked or bad SIM, I believe it should still read the network as being present. It would just not let you connect to the network.
Although, replacing the SIM is an easy and cheap thing to try. At least to eliminate it as the issue.
Please click the "Thanks" button if you found a post helpful!
Phone: AT&T HTC One (M8)
Tablet: Samsung Galaxy Tab Pro 8.4 (WiFi only)