Why is a portion of my 529 plan distribution taxable when all distribution amount was used to pay qualified education expense

I was paying college for my child and trying to get distribution from 529 plan to reimburse myself.

 

On my 1098-T Box1 (total expense) = $53,236, Box5 (school grant)=$24,500, so my out of pocket expense for 2022 is $53,236-$24,500=$28,736

 

On my 1099-Q, Gross distribution = $20,007 ($9,417 is earning). 

 

Because distribution $20,007 is less than what I paid $28,736, I think the distribution should be fully deductible, yet TurboTax shows I owe a tax of $598. I looked into the 1099-Q form calculation sheet (page 3), under the “qualified tuition problem computation of taxable distribution” section on line 2b, there is an amount $18,736, but I don't know how the number came to be.