The magnesium displaces the copper ... If chlorine is added to a solution of sodium bromide, a reaction occurs: But if iodine is added to sodium chloride or sodium bromide, no reaction happens.
More information: Takatsugu Murata et al, (E)-Selective Weinreb Amide-Type Horner–Wadsworth–Emmons Reaction: Effect of Reaction Conditions, Substrate Scope, Isolation of a Reactive Magnesium ...