If a college is applying grants/scholarships towards your tuition bill, then the remaining balance are the qualified expenses you can pay from your 529.
If your withdraw more from your 529 than actual expenses for that period, then you are not using the money as agreed-upon when you decided to receive a multi-year tax benefit, hence the penalty.
If possible, retain the money in the 529, and use it after college for graduate school. Who knows, you might seek a masters or decide on a second degree. Or, possibly even transfer the benefit to another family member for them to afford private/boarding school, their college education, etc.