Getty

Danny Masterson is throwing his lawyer under the bus ... the actor is seeking to have his rape convictions tossed aside, claiming he's sitting in prison because his lawyer didn't do his job right.

In new legal docs filed Monday, Masterson's lawyers claim the trial attorney who handled his rape case failed to call key witnesses or contradict the prosecutor's claims about Scientology ... despite Masterson's insistence. SplashNews.com

According to the court docs, Philip Cohen -- who Masterson says took over trying the case due to a scheduling conflict with his former lead attorney -- only spoke to 2 of the "more than 20 potential witnesses" who could have testified in his defense.

He says Cohen "wrote off the great majority of them without any personal contact" despite their

See Full Page