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.