Prior year scholarship withdrawal from 529

If OP is asking about withdrawing non-qualified 529 funds now based on scholarships received in prior years and paying income tax on the earnings but claiming an exception for the 10% additional tax (“penalty”), than yes, the general consensus is that you can do that.

See “Mistake #6” in the linked article:

https://www.forbes.com/sites/josephhurley/2016/02/04/dont-make-these-mistakes-when-reporting-529-plan-withdrawals/#6a6e493d6155