This reaction doesn't look promising at all, but it can be made to work by heating the ammonium salt strongly. You may have noticed that we haven't tried acid catalysis of any of these reactions between amines and carboxylic acid derivatives. That's because any acid we add will react with the amine, so the strongest acid we can have in the reaction is the conjugate acid of the amine. Now to a reaction we haven't seen before. We will look at nitrosation because it follows on fairly naturally after the reactions of amines with carbonyl groups.
Nitrous acid is formed, but it reacts further with acid to make water and the nitrosyl cation.
The nitrosyl cation is electron deficient. Its nitrogen has only three pairs of electrons in the valence shell, so it is a very good electrophile, very susceptible to attack by a nucleophile. The beneficial effect of sodium nitrite in preventing botulism poisoning must be weighed against the potential hazard of N -nitrosoamine carcinogenesis. As with many dietary hazards, the longer term effects are difficult to determine. When the amine is primary, its reaction takes a different course.