Cannons explode all the time, and they always have all throughout history.
In this case, he had a 'ceremonial' cannon which was meant to make a big noise.
That is to say, it was not designed to fire a projectile.
It exploded because he stuffed it with confetti (or whatever) and caused a backfire.
Or, he got excited and wanted to impress the crowd so he went crazy with the gunpowder, or both.
Bottom line is, backyard cannons are great 99% of the time, like lawn darts or smoking at the gas station.
But that 1% of the time, is deadly.