I found out what the problem is.
The same thing happened to me.
Emergency calls only, couldn't connect to a network, out of service state, IMEI was fine.
I went to the network operator that sold me the phone, and they scanned my phones barcode and told me the phone is blacklisted.
Go to your network operator and check if this is the case. I'm 99% sure that it will be. You ought to be able to unblacklist the phone