It's a fair question - the first reaction in the pot is almost certainly the ammonia reacting with the acid to form an ammonium salt. However, that reaction is reversible, and ultimately the protonation and corresponding activation of the carbonyl towards nucleophilic attack is evidently more than enough to compensate for this, i guess