Interestingly if the refund is counted as a new after tax contribution then it will raise the effective tax basis of your account (ie a lower percentage of future distributions will be earnings). That is modestly beneficial if money is eventually left over and is taken as a taxable withdrawal.
As an example, say you had $50K in there which was half contributions and half earnings and had withdrawn $10K for this semester. If you put back $5K then you will now have $25K contributions and $20K of earnings and future withdrawals will be 55.6% from contributions and 44.4% from earnings. Any money left over will be in this proportion also. Whereas if you’d kept the original amount in your checking account the 529 balance would still be 50% earnings.
This occurred to me as well the first time I was involved with recontributing a refund of 529 money. It’s just another one of those 529 things that hasn’t been taken into account in either the IRC or IRS regulations.