So the question is why doesn't transesterification occur? Two reasons - one kinetic and one thermodynamic. It's mainly because amines are more nucleophilic than alcohols and if you want this reaction to occur, you use a 1:1 stoichiometry of your starting materials. You might get a bit of trace ester product but amine attack is kinetically favored because amines are more nucleophilic. Thermodynamically speaking, amides are also more stable than esters. Therefore, the amide product will also be energetically favored.