The reaction proceeds through a diazonium salt intermediate formed by displacement of the chloride with diazomethyl anion.
If excess diazomethane is present during the reaction, it can act as a base, abstracting a hydrogen from the diazonium-salt intermediate.
Instead, the byproduct, diazonium-methyl from the other diazomethane molecule, can be attacked by the chloride to produce chloromethane.
The unreactive diazoketone can be re-activated and reacted by treatment with hydrogen chloride to give the normal Nierenstein product.
In some cases, even limiting the amount of diazomethane gives a reaction process that stalls via the neutral diazoketone pathway, requiring the addition of HCl gas to rescue it.