529 Defunding as Child attends school

So if my son gets, say, a 30k need-based grant I can withdraw that amount from the 529 the same calendar year the grant is given and be okay with the 529 withdrawal rules? If so, that’s amazingly good news.