Bam Margera insists he tried everything he could to appease "Jackass 4" producers and stay on the project, but claims what they wanted almost killed him ... and he has no choice but to take legal action now.
The 'Jackass' star was out in Hollywood Thursday when we talked to him about getting kicked off "Jackass 4" after another stint in rehab ... one he says made his life much worse.
Bam claims Johnny Knoxville and others had strict terms for him, including a 90-day rehab stay for alcohol and Adderall. The problem, according to Bam, is he came out with a laundry list of 18 different pills the rehab folks wanted him to take. You gotta watch ... he actually names them all, and believes that's what led to his suicidal thoughts.
On top of that, he accuses Johnny -- or as he sarcastically called him, "Dr. Knoxville" -- of ordering him to stay off 2 drugs his own doctors had prescribed for him.
Ultimately, Bam says all those pills rehab put him on left him feeling like he was gonna die from an overdose or suicide ... which made a huge payday for 'Jackass' totally meaningless.
He's blaming producers for the whole situation, calling their treatment "torture" ... and he's very upset that something he's wanted to do for 10 years to honor his late friend, Ryan Dunn, has come to this.
We broke the story ... Margera got booted from the upcoming 'Jackass' film in February for not abiding by contractual conditions related to his addiction issues. Bam suggests to us that it was due to his continued use of Adderall.
His firing came shortly after Bam's troubling online rant in which he called for a boycott of "Jackass 4" and talked about suicidal thoughts.
We've reached out to Knoxville and MTV about Margera's comments ... no word back yet.