Bugsy Malone/WMG

The entire film is actually a real gangster's fantasy.
Bugsy Malone is a mentally disturbed gangster, who cannot deal with the reality of the violence that permeates the prohibition wars. So to deal with it, he constructs a fantasy where everyone is a child, and the weapons are harmless, by being custard pies and the like. The final sequence (where everyone gets killed) is his dying fantasy where all the gangsters stop their fighting and become friends, similar to Travis Bickle's dying fantasy in Taxi Driver...