Robin Williams was "devastated' when his TV show, "The Crazy Ones," was cancelled ... sending him into a deep depression that ultimately led to his suicide.
Sources who frequently interacted with Williams during the last month of his life tell TMZ ... Williams viewed the cancellation as a "personal failure." As Williams put it to one person just before the show debuted, "My face is all over town [on billboards] and it's all on my back."
We're told the cancellation after only 1 season sent Robin into a tailspin -- as one person said, "It hit him hard" -- and that's why he entered the Hazelden Addiction Treatment Center last month -- not for substance abuse, but for depression.
To make matters worse, we're told Robin was increasingly depressed that he was older and good roles for him were few and far between. He would talk about Robert De Niro, saying even he was having a hard time.
Our sources say Parkinson's disease wasn't nearly as significant a factor in his depression as "The Crazy Ones." We're told Robin knew he had the disease for 5 months.
One confidant tells us, "Robin was told by doctors the medications were so great he wouldn't even start to show symptoms for 6 or 7 years."