On the tax issue only, this is basically an overpayment. IRS rules are that if the repayment occurs in the same year as the overpayment, then it is paid net of taxes and the employer adjusts the tax deposit. If instead the overpayment is repaid in the following year(s), the payment is made gross (including taxes) and the employee gets the refund from IRS. Agreed the W2 needs to be corrected by the employer if it includes the overpayment.
State law says whatever state law says. Often it follow IRS but not always.
Not the question but so-called "conditional wage payments" (what we see here) are not directly addressed in the IRC, but treating them as an overpayment is not optimal. There is some advantage to formally structuring the payment as a loan, the conditionally forgiving the loan at a later date.

