A dimethylamide anion is a highly active nucleophile, which makes it a bad leaving group. Remember that the two alkyl groups are electron-donating, thus destabilizing the negative charge on N. (blue mechanism favored) [![enter image description here][1]][1] However, in the case of a Weinreb amide, the oxygen atom adjacent to the nitrogen atom decreases the electron density on nitrogen, so that the attack from the nitrogen atom becomes unfavorable. Moreover, the methoxylamide anion becomes a much better leaving group, due to the oxygen atom stabilizing the negative charge. (red mechanism followed) [![enter image description here][2]][2] [1]: https://i.sstatic.net/yc0Aj.png [2]: https://i.sstatic.net/Dfvf5.png