Robin Williams appeared "deeply sad" while filming The Crazy Ones.
The 63-year-old actor, who was found dead by his personal assistant after he hanged himself at his home in Tiburon, California on Monday, August 11, appeared "exhausted" while working on the CBS comedy, which was axed earlier this year after just one season.
A source told PEOPLE magazine: "We knew he was struggling."
The insider recalled that in the middle of one scene, "his face changed. He looked so exhausted and profoundly, deeply sad. And then one minute later, he pulled himself back together, and he nailed the scene."
Bob Zmuda, the creator of the Comic Relief charity, also said: "He was a guy who had the highest of highs while performing. But when he walked off that stage and went back to the dressing room alone, he could face the lowest of lows."
But the Oscar winner, who sought treatment in rehab last month, was also reportedly struggling financially in recent years and was devastated when the series was cancelled.
Another source told gossip website RadarOnline: "Robin slipped into a deep depression.
"He felt embarrassed and humiliated that the show had been a failure. It was very hard for Robin to accept.
"Here he was in his sixties, and forced to take a role on television for the money. It’s just not where he thought he would be at this point in his life.
"There was also frustration that Robin expressed at having to take television and movie roles he didn’t want to take, but had to for the paycheck."
Meanwhile, the Williams family has asked well-wishers to send donations to several charities close to the actor’s heart, including his late friend Christopher Reeve’s foundation, in lieu of flowers ahead of his funeral.