I misunderstood box #12 DDon my W2 that I had contributed that amount to HSA and am filing amendment. Will I receive original refund and I pay the $582 now owed?

Original refund $3677, when I corrected HSA contribution on amendment it is indicating I owe $582.  Does that mean I am not getting the $3677 after I pay the $582?