Deductions & credits

Yes ... you did have it backwards ... what you had withheld is on the form 1040 AFTER the credit was applied so if you have zero in taxes and paid in $XXX  then you will get the entire withholding back in a refund.  The form 1040 is really a long math problem worked in order from line 1 to 37 ... the order cannot be changed.