1:35 PM PT -- A rep for the Montgomery County D.A.'s office tells TMZ, "This was an ill-advised attempt at humor related to stories in the news at the time. No communications impacted the administration of justice in the investigation and prosecution of Mr. Cosby."
Bill Cosby should have been ambushed by 27 women, who accused him of sexual assault, with "small, very sharp knives" during a 2015 TV interview ... according to one of the lawyers on the case.
The Montgomery County D.A.'s Office just released -- under court order -- emails regarding Cosby, and in one exchange from October 2015, obtained by TMZ, prosecutor Stewart Ryan responds to an article link sent by Deputy District Attorney Thomas McGoldrick about NBC's "Dateline" airing a joint interview with the 27 alleged victims.
Ryan replies with a joke about setting the disgraced TV dad up "To Catch a Predator"-style ... by inviting him to the interview, ambushing him and allowing the women to interview him.
McGoldrick takes it a step further, though ... by suggesting Cosby's accusers be allowed to "interview" him with knives.
The "Dateline" episode aired a few days later, and less than 3 months after that ... Cosby was charged with felony sexual assault of Andrea Constand by the D.A.'s office.
As we reported ... he was found guilty in April 2018, and a few months later he received a sentence of 3 to 10 years in a Pennsylvania state prison.
Andrew Wyatt, a rep for Cosby, tells us ... “This exchange helps to prove Mr. Cosby’s case was a political scheme to take down America’s Dad."
He adds ... "The whole plan was in place years before Cosby was brought in. It’s a formula to take down a wealthy black man in entertainment that will continue to be used."
We reached out to the Montgomery County D.A.'s office ... no word back so far.