I've seen this error several times with my customers and these are some of the possibilities.
# Did you change service provider recently, such as from Verizon to AT&T? If that's the case, then it means that the phone is not unlocked and can only be used with a specific provider.
# It could also mean that the SIM card has malfunctioned, and needs to be replaced with another one.
# Lastly, maybe the service on the phone came to an end (prepaid service and didn't add funds, services were cancelled.) With phones from SafeLink, Assurance Wireless and others; if you don't use your government provided service at least for one call and one text a month, then the service get's disconnected, and that's when you may see that error.
# Hope this helps.