I believe the concern here is whether a tax liability arises (plus a 10% penalty) for having withdrawn money for other than qualified educational expenses. If it was a refund, and it was re-deposited within the 60 day window, then there would be no tax liability once you file your return.
If I recall the IRS regs correctly, the 529 plan is not required to track/differentiate this on their end.
When I had done this because spring housing was refunded due to start of pandemic, I sent the re-deposit cheque with a cover letter citing the specific refund and circumstances, requesting it not to be treated as a new contribution - and then kept a copy as backup with that year’s tax return!