529 withdrawal after graduation for undgrad tuition

I concur with DigitalDad; you can wait until the end of 2023 to take a 529 distribution for qualified expenses paid in 2023, even if the student is no longer enrolled at the end of the year.