One of the steps in fipronil synthesis is this reaction (Im sorry, i got the scheme wrong, its not NaNO
2)

To 2,6-dichloro-4-trifluoromethyl aniline 230 g and acetic acid 150 ml was added 1.1 m of nitrosyl sulphuric acid over one hour at 30° C. and maintained at 30° C. for one more hour. Heat the mass to 50-55° C. over ½ hour and the absence of 2,6-dichloro-4-trifluoromethyl aniline was monitored. Cool the mass to 30° C., and the excess nitrosyl sulphuric acid was destroyed.
The above diazotized mass was added to a mixture of 250 ml of acetic acid, 162 g ethyl-2,3-dicyanoproprionate and 425 ml water over 4-5 hours maintaining temperature 0-5° C. Further maintained at 0° C./2 hours, 5° C./1 hour, 10° C./1 hour, 15° C./1 hour. 800 ml water was added at 15° C. over ½ hour, extracted the solution with 3×250 ml methylene dichloride. Layers were separated. Dichloromethane layer was washed with 250 ml water, cooled the dichloromethane layer to 0° C. and washed with 250 ml 8N aq. NH3 under stirring for one hour. Layers were separated, dichloromethane layer was taken and NH3 gas was passed at 0-5° C. till free NH3 was observed on top of the condenser and maintained the reaction mass for 3-4 hours at 0-5° C. Then 250 ml water was added, stirred for ½ hour, layers were separated, extracted aq. layer with 2×100 ml dichloromethane, dichloromethane layer was dried with MgS04, dichloromethane layer was concentrated to dryness, to obtain 288 g of 5-amino-3-cyano-1-(2,6-dichloro-4-trifluoromethyl phenyl)-pyrazole of 98% purity.
from US 20130030190 A1
_________________________________
And I dont understand the reaction:
The diazotation step seems straightforward but then the condenstation product have one less carbon it seems that it decarboxylates but the temperature is kept rather low for decarboxylation?. And then, the nitrogen next to the seems to atack the nitrile carbon but arent both the carbon and nitrogen from diazonium salt electrophilic? I would expect that the amino group would be in position 3 and the cyano group in position 5?
Any misconceptions on my part?
Thanks