Labour's ruling National Executive Committee blocked the Greater Manchester mayor from standing in a by-election.