A few comments, in reverse order.
First, code violations are civil, not criminal, in every jurisdiction I've ever heard of. What state are you in? The only way they become criminal is if you refuse to comply for long enough that a judge finds you in criminal contempt. In this case, I'd be shocked (even assuming shutting off the emergency disconnect would get you a citation, which seems unlikely, see below) that the first ticket would simply be an order to turn it back on. From there if you refused to comply it would escalate to fines, then increasing fines, then a court order to turn it on and pay the fines.
Second, the purpose of codes like this is to make sure that the house is livable. I expect the code (if it actually says a grid connection is required) was written before self-generation was realistically feasible and just wasn't considered. Odds are a house that has plenty of electricity but is technically in violation wouldn't be cited, unless you sold the place and the new owner complained, and even then they'd probably just require you to pay for reconnecting it. Further, I expect that as long as your house is still physically connected, it would be in compliance so if you were cited a judge would throw it out.
Of course, you shouldn't take my word for it, but it's pretty easy to find the laws and codes online. I'm curious enough that if you tell me where you are, I might even look them up for you :-)
That said, there very well might be something the power company can complain about if you try to get service disconnected so you don't have to pay the monthly connection fees. There might be some law giving them the authority to issue citations, essentially for non-compliance with their contracts. In practice, what would probably happen if they have that power and you called to disconnect is that they'd just tell you "no". But I'd really be surprised if they complained as long as you kept the service and paid the basic monthly fees; from their perspective it just looks like you're paying them money for nothing.
Finally, not having an exterior emergency disconnect is a serious code violation from what I can find (NEC 230.85 (that link is from NY, but the code is national)), so you might already have a code violation. I guess it depends when that requirement was added to the code vs when your system was installed, but you said your system was just redone recently?