Retirement tax questions

The extra income on the W-2 could have dropped the refund (or affected a credit)  and has nothing to do with the HSA contribution at all.  Nothing happens in a vacuum on a return.   Review the entire return to see what is being calculated.