It's a challenge actually to prevent everything from igniting prematurely. Especially with mortars, since they're propelled out of a tube with an explosion that can compromise the shell, igniting its contents immediately rather than up in the air as intended.
If you've ever seen a public fireworks display where the stars exploded awkwardly close to the ground instead of way up with everything else, it's likely because the explosion for thrusting it into the air managed to ignite the contents instead of the delayed fuse.