529 distribution in wrong year

I made the mistake of taking a 529 distribution in late December to pay for the Spring tuition. I thought that since it was sent directly to the university that I'd be OK. Unfortunately, my 529 plan had it in 2022 and the university didn't include it in the qualified expenses for 2022. I'm within the 60 day window to roll over or refund the money back to the 529. Is that the best thing to do here. Refund the money back to the 529 and then take the distribution in 2023?