He plead guilty to lying to FBI, which isn't a crime when you are not under oath. Sullivan gave him numerous chances to change his plea. Flynn refused. This means Sullivan has now put himself in a bad spot, and for the first time in history, a second judge has been called in to "do something" in the case.
There is a theory that Sullivan is doing all this to setup the prosecution for knowingly prosecuting Flynn on something that wasn't a crime. There's also what the facts support; Sullivan was in on it, and trying to take Flynn down.