In the fallout of a State Police drug lab scandal, authorities in New Jersey overhauled how they test marijuana evidence, moving to dismiss more than 1,700 drug cases.

They are among the more than 7,000 cases called into question when a lab technician was accused of falsifying test results from a single marijuana sample in 2015 – a legal mess still being untangled by a judge appointed by the Supreme Court to handle the glut of legal challenges.

But the technician at the center of the ordeal, Kamalkant Shah, now says it was all based on a lie, alleging in a lawsuit that the accusations were drummed up by his superiors as he grappled with a mental illness for which he was actively seeking treatment.

State authorities said at the time they were re-testing Shah’s work “out of an abundance of caution" and a spokesman for the Attorney General’s Office said prosecutors were in the process of dismissing 1,711 cases in which the drug evidence had been destroyed before it could be retested. While the state is seeking to dismiss the drug charges in those circumstances, any other criminal charges that may apply are unaffected, the spokesman said.

The lawsuit adds new details to a controversy that led to major reforms in how authorities in New Jersey handle marijuana evidence at a time when lawmakers are debating legalization. It also raises questions about state oversight of the laboratories where key drug evidence is tested.

“The actions of the state destroyed his life," said his attorney, Brian Curley. "He’s been living in constant fear that he’s going to be criminally prosecuted.”

Ultimately, he was never charged with a crime. And to date, NJ Advance Media has learned, state authorities have retested 1,644 cases Shah handled and have yet to find a single sample he got wrong.

The suit claims the state’s handling of the case violated Shah’s civil rights. A spokesman for the state Attorney General’s Office, which represents the State Police in court, declined to comment on the allegations in the suit.

Shah claims he was subjected to racial harassment from coworkers and pressured to retire before he was accused of deliberately mis-recording test results and threatened with criminal prosecution. While he made minor mistakes, Shah concedes, he never falsified test results and “was never issued any official written reprimand” for his work performance.

According to his lawsuit, Shah worked for the State Police as a lab technician since 1989. After he began working at the North Regional Laboratory in Little Falls in 2005, the suit claims, Shah was “consistently subjected to a work environment and climate that was hostile to his Indian ethnicity and his Hindu religion" and was “singled out and subjected to disparate scrutiny in his testing work” compared to his white coworkers.

The technician claims he suffered from depression that began to affect his performance and after an unspecified “incident” at work arranged through his supervisors to see a counselor in November 2015.

But citing two other cases in which older lab workers were allegedly forced into retirement, the lawsuit claims Shah’s superiors were already looking to oust him. In December of that year, a coworker secretly recorded a 26-second video of Shah rolling into the frame on his desk chair, putting a sample under a microscope and quickly wheeling himself off screen.

The coworker gave this video to supervisors, who claimed it showed Shah was “dry-labbing” a marijuana sample, a term that means recording a positive result without checking to make sure. Shah says the video doesn’t show the whole story, claiming he returned to the sample after the camera stopped recording.

The video led to a cascade of events: Lab supervisors notified state officials, who raised the alarm to county prosecutors. Word got out to defense attorneys, and then the media. By March 2016, the issue had become a scandal, and state prosecutors soon requested the Supreme Court appoint a “special master” to handle the fallout. In early 2017, the Attorney General’s Office agreed to move to a more reliable form of drug testing to prevent future problems.

In letters obtained by NJ Advance Media after the scandal became public, county prosecutors noted there were other errors Shah had made in drug test results that had raised questions.

The technician’s lawsuit notes that supervisors found he was “distracted and unfocused."

But the lawsuit alleges Shah was never formally reprimanded for his performance and he was entitled to “reasonable accommodation of his psychological issues while he sought assistance.” Instead, the suit claims, Shah’s supervisors urged him to “retire immediately,” and even accused him of stealing drugs from the lab, a charge he denied completely.

The employee who recorded the video, the suit claims, was one of Shah’s “tormentors” who had demonstrated “extreme prejudice” against him, frequently mocking his religion and his accent.

A spokeswoman for the state judiciary said the special master, Judge Edward Jerejian, is still reviewing legal challenges raised as a result of the controversy, which includes 7,827 cases connected to Shah.

S.P. Sullivan may be reached at ssullivan@njadvancemedia.com. Follow him on Twitter.

Have a tip? Tell us. nj.com/tips

Get the latest updates right in your inbox. Subscribe to NJ.com’s newsletters.