It is legal so long as you are not being overtaxed: that is, that the total taxes taken out is what should have been taken out between the two checks. In this case, if the total amount taken out is correct, you are not actually losing anything--you received the money faster in fact, all during the first week, but are not actually out anything--so you, having suffered no loss or damage, have no claim; and the law permits mistakes to be corrected so long as it does not damage the other party.