Make a backup of your save data when you enter the special stage, and reload that data if/when you fail. If you reach your first firework with a high number of free spins remaining, create a new backup. Do the same if you reach your second firework with a high number of free spins, etc. See my forum post for more details.