I think that you are doing Wolff-Kishner reaction in which hydrazine acts as a nucleophile. After hydrazine attacks the carbonyl of the ester, there will be deprotonation (loss of H+ from hydrazine attached to C of C=O) in the first step. Adding HCl will mess things up by causing protonation (the opposite case) & salt formation in the desired hydrazide product if it had formed. Instead, there has to be good thinking about helping the reaction to reach the final product (which is as stable as an amide).