If none of the box 1 amount was used for qualified educational expenses, in 2021, the entire earning portion, of the distribution, is taxable and subject to the 10% penalty ("additional tax").
The 0 in box 2 most likely means that the ESA administrator did not provide the earnings amount and you have to calculate it from your own records. You may have to contact them to verify that.
If the account actually loss money, over the years, there actually my be 0 earnings. In which case, the 1099-Q does not need to be reported. So the 0 in box 2 could correct. You need to verify that with the account administrator or from your own records. Losses, in an ESA are not deductible (they were before 2018).