529 Distribution to pay off old Student loan for beneficiary

My son took the student loan in 2021 & 2022, but I paid it off now in 2023.  I received a 1099Q in my Name with Box 6 checked (for the Recipient is not eh designated beneficiary).  The amount is under $10k.  Do I need to enter 1099Q in my or my son's 2023 tax return?  If I do, what do I enter for corresponding Education Expenses as the education expense was incurred in 2021 & 2022 when he took the loan to pay off tuition (not in 2023) when I paid it off using 529 distribution (for which I am the account owner, and my son is the beneficiary).  I want to understand how to report it accurately in my 2023 tax return.