of course the machine can do that.
if the check out person did not manually punch in the actual charge number, but the machine itself did that, then it is mostly probably your card just had that much balance left.
when you could not get the card back even it was empty, you should report to the store manager to avoid any future issue.