This displacement can occur via a rearrangement (path A), in which one of the sigma bonds adjacent to the diazo group migrates.
One example of this is a study conducted by D. Fattori looking at the regioselectivity of the Demjanov rearrangement in one-carbon enlargements of naked sugars.
[6] It showed that when an exo methylamine underwent Demjanov nitrous acid deamination, ring enlargement was not produced.
Using the Tiffeneau-Demjanov reaction is often advantageous as, while there are rearrangements possible in the products, the reactant always undergoes ring enlargement.
Diazomethane also produces ring enlargement, and its reaction is mechanistically similar to the Tiffeneau-Demjanov rearrangement.