What are the consequences and what corrective action needs to be taken if a plan sponsor refunds a deferral during the year of the deferral (rather than doing the refund after the end of the plan year) in anticipation of failing the ADP test?

Does it matter which of the following 2 actions the plan sponsor took;

1) left the deferrals in the plan, reduced subsequent deposits of deferrals by a certain amount, and paid that amount as salary; changed the accounting for the deferrals appropriately

2) paid the deferrals out of the plan, just as would have occured after the end of the plan year?