A spokesperson for Manhattan Criminal Court Judge Felicia Mennin — who sentenced Tekashi in October for his 2015 child sex case — tells TMZ the error was in the plea deal prosecutors struck with 6ix9ine’s attorneys.

According to the spokesperson, “The original sentence was the result of a negotiated plea. All parties involved, the prosecution, defense and the [trial] judge (not Mennin) signed off on it.” Now, here comes the big BUT … “As an error was made, the case was placed back on the calendar and the sentence corrected.”

Translation: Judge Mennin dropped Tekashi’s probation Tuesday, and gave him credit for time served to correct an oversight — namely, that the terms of the plea deal were unlawful.

Remember, Judge Mennin handed down a light sentence of 4 years probation as opposed to jail time. Sentencing guidelines for a class C sex assault felony — for which 6ix9ine was convicted — call for a minimum of 10 years probation, and a max of 5-15 years in prison.