Analyze That
(2003)

The heist goes on flawlessly, until it turns out that Eddie (Raymond Franza) was a traitor: he intended to rob everyone off the gold, including Patti LoPresti (Cathy Moriarty) and Lou Rigazzi (Frank Gio), and keep it for himself, thus establishing himself as a new boss.  This enrages Dr. Sobel (Billy Crystal), and he stands up and gives Eddie a good beating.  The rest of Paul's (Robert DeNiro's) gang reacts and fights back as well against Eddie's other goons.  They are all locked in the robbed armored truck, which is lifted on the crane and left hanging for the authorities.

The gang escapes in the bus where the gold was stashed.  However, Paul gets a conscience about the trouble this gold would bring him both with the FBI and Rigazzi, who wouldn't stop pursuing him for it.  So, he decides to frame Rigazzi for it.  An anonymous phone call is made, and the FBI seizes the entire stash from Rigazzi's premises, and he and his crew are arrested.

In the end, Paul manifests that he doesn't feel too happy for dumping 20 million dollars like that, but it was good to do the right thing, even though he won't give up the only way of life he knows.  He, Jelly (Joe Viterelli) and Dr. Sobel thank each other for their mutual support, and they go part separate ways, singing a tune from "West Side Story".

The movie ends, and then we are shown some filming bloopers, along with the rolling credits.
 

Thanks Dr Mat!