One could well understand if President Trump’s fired National Security Adviser Michael Flynn was a tad confused Tuesday at his sentencing hearing on his guilty plea to a single count of making false statements to federal investigators.

Flynn appeared before Judge Emmet G. Sullivan in U.S. District Court in Washington to be sentenced for lying about topics he discussed with then-Russian Ambassador to the U.S. Sergey I. Kislyak – but never got a sentence.

Instead, Flynn surprisingly found himself being hammered by Judge Sullivan on whether he could be charged with treason and for working as an unregistered agent on behalf of Turkey. Then Sullivan warned Flynn he might sentence him to prison time.

That led Flynn to accept the judge’s offer to delay his sentencing until he completes his cooperation agreement with Special Prosecutor Robert Mueller’s team of investigators.

Mueller had recommended that Flynn, a retired Army three-star general, get no prison time following Flynn’s assistance to the Mueller team that is investigating whether the Trump presidential campaign colluded with Russia to help elect Trump.

Flynn has met with Mueller’s team 19 times to answer questions, but there has been no public disclosure of what he told investigators.

Sullivan’s harsh attack on Flynn was a surprise. It left Flynn in the position of someone being hit by a train – when the train was miles off its track.

Sullivan began the sentencing hearing by expressing his concern over the way Flynn was interviewed without counsel by the FBI. However, the judge soon took off in a dramatically different direction.

At points using the flag in the courtroom as a prop, Sullivan said: “You were an unregistered agent of a foreign country while serving as the national security adviser to the president of the United States. That undermines everything this flag over here stands for. Arguably, you sold your country out.”

Sullivan also asked prosecutor Brad Van Grack: "Hypothetically could he have been charged with treason?"

First and foremost, raising a treason charge is so wildly out of place on this record that it could have been viewed as an attempt by the judge at being facetious. The man in front of Sullivan was accused of lying in an FBI interview, even though the FBI agents who interviewed Flynn did not believe his false statements were intentional.

Flynn was accused of lying not about speaking with Ambassador Kislyak – something neither unlawful nor unprecedented for an incoming national security adviser – but of failing to acknowledge that he and Kislyak discussed U.S. sanctions on Russia and Russia’s position on an upcoming vote in the United Nations regarding Israel.

Significantly, none of what Flynn and Kislyak discussed had anything to do with alleged Russian collusion with the Trump campaign on the 2016 presidential election or the other matters under investigation by Special Counsel Mueller.

Conversely, treason is defined as levying war on the United States or giving aid and comfort to a nation with which we are at war. Even raising the question of such a charge against Flynn for his work on behalf of Turkey – a NATO ally – is absurd.

The most worrisome statement by Judge Sullivan involved Flynn being a foreign agent as national security adviser. Flynn’s work as a lobbyist has been raised in the investigation, but this was work Flynn did before he became national security adviser in the White House and was unrelated to the Russia investigation.

Yet the judge cited Flynn’s lobbying on behalf of Turkey as an aggravating factor he was considering in sentencing Flynn – despite the fact that this was not being used by the prosecutor as an aggravating factor.

Flynn has never been accused of being a foreign agent as national security adviser. Flynn did retroactively declare that his work between August and November 2016 as a lobbyist “could be construed to have principally benefited the Republic of Turkey.” That work was not for Russia and such retroactive declarations are not uncommon.

Indeed, various figures like Democratic powerhouse Tony Podesta (brother of Hillary Clinton campaign chair John Podesta) filed the same retroactive declaration under the Foreign Agents Registration Act involving the same underlying work for the same country.

Violations under Foreign Agents Registration Act (until the Mueller investigation) were rarely prosecuted as criminal matters. The vast majority of cases were matters of simple filings and fee payments, or in a few cases civil penalties.

The failure to file as a lobbyist for Turkey under the Foreign Agents Registration Act hardly makes Flynn the modern-day equivalent of Benedict Arnold. It makes him the Republican version of Tony Podesta, who is enjoying his retirement in his home in the upscale Kalomara neighborhood of Washington a few doors down from the former President Obama and his family.

Sullivan tried to walk back his comments while menacingly asking Flynn repeatedly whether he was sure he wants to be sentenced. Flynn got the message and said that he would wait.

Some legal analysts immediately pounced on Flynn’s counsel for the fact that the FBI worked to interview Flynn without counsel. One – former White House Counsel Jack Quinn – even suggested on CNN that Judge Sullivan could well be concerned that an ineffective counsel claim was forthcoming due to the filing of the Flynn defense.

However, this ignores the fact that Sullivan said that he found the information troubling and took the rare step of ordering the FBI “302” investigative reports to be made public.

Moreover, it is hard to believe that Quinn – a Democrat who worked for President Clinton, Vice President Gore and other Democratic elected officials – would have looked kindly upon the decision of FBI Director James Comey to ignore the longstanding protocol of contacting the White House counsel before interviews like the one conducted with Flynn.

All of this drama in court Tuesday came in a case where both sides agreed on zero prison time for a first offender who had a record of 33 years of service in the U.S. Army.

Moreover, Mueller admitted recently that while former Trump personal attorney Michael Cohen lied repeatedly to investigators, prosecutors simply allowed him to correct the record without facing additional charges.

And earlier in Mueller’s investigation, a non-cooperating witness – lawyer Alex van der Zwaan – received just 30 days in prison. In the same investigation, a witness who cooperated but then fell out of favor with Mueller received just 14 days in prison.

Flynn will in all likelihood still receive zero prison time after Mueller files a more detailed account of his cooperation. Given the cooperation previously noted and the maximum of a six-month sentence Flynn could face for his guilty plea, Sullivan was likely considering a sentence of less than three months to start within Tuesday’s hearing.

As the judge works up and down that short sentencing spectrum in the next hearing, Flynn should stand accountable for the crime he confessed to – and not the crimes imagined in his record.