Dependent as a full time student drastically changes my refund for the worse

I have an interesting situation as a divorcee of 12 years. I have a 19-year-old son, a full-time student who lives in an apartment.  I pay his rent, and he is on a full scholarship.   As part of the divorce decree, we switch off who is head of household and who can claim him as a dependent.  2024 is my year to be head of the household.  I answered the dependent questions, stating he didn't live with me (apartment with me paying the rent), being claimed on my ex's return, he didn't make more than 5k, and I paid more than half his living expenses.  Since he didn't live with me, my filing status was set to single instead of HoH by TurboTax Premium web version.  At this point, I have a $21 refund before I get to "less common situations" for my dependent.  If I check the box for "was a full-time student" in 2024, I go from getting a refund to owing $479 to Federal.  If I leave it at NONE of these apply, it stays at $21 refund.  Why is this happening?  I seem to be getting punished for paying for my son to live in an apartment while he is a full-time student.