The judge bangs a gavel to maintain order in the court and confirm Toad's sentence. British judges don't use gavels.
Although Badger and Rat swapped the labels round on the barrels to make sure that the explosives were delivered to the factory, the plunger would presumably have still been wired up to the ones in Toad Hall, so there shouldn't have been any explosion at all when the Chief Weasel pressed it.