I'm the account owner of a 529 for a grandkid. I took a withdrawal and paid the school. Can I prove it was a qualified education expense and not get a tax and penalty?

I didn't realize there was a tax and penalty if you are the owner, but beneficiary is not your dependent.