Currently, there's no command that can remove the alternative muzzle's magazine (e.g an under-barrel grenade launcher). I think this is what "removePrimaryWeaponItem" was supposed to do, since according to its description:
> Removes given weapon item from the primary weapon cargo space.
> As of Arma 3 DEV 1.37, this command also supports weapon magazines.