College refund from 2022 payment.

Hello,

 
My daughter had a college refund on 3/15/23 and I did not know that I had to recontribute that refund to my 529 account to avoid any tax attached to it. The tax law states that people need to recontribute college refund to their 529 plan within 60 days in case the money was withdrawn from 529 plan and was paid to college. I googled up other alternatives and one of them said that I can use that money for other eligible education expenses in the same year, but my problem is that the refund is from 2022 college payment. The regulation said that I need to spend the refund in the same tax year. My question is when it says " same tax year" does it mean the year the refund is issued, or the year the original payment to the college was made? My another question is that one expert recommended that I can use to pay off the student loan. Then I do not have to pay taxes. Is that right?
 
This is the copy of the refund that I got on 3/15/23. I paid 2022 fall semester and 2023 spring semester with the money I withdrew from 529 account in 2022.
 
"Date Posted Term/Session Description Amount
N 02-Mar-23 2022 Fall Refund - Student 44,535.00
N 02-Mar-23 2023 Sprng Student Refund 44,535.00
N 02-Mar-23 2023 Sprng XXXX Univ Grant-Appeal --9,070.00"
 
Thanks for your help.