Wow, that is incredible. Not your fault, and insane of Upwork to ask you to refund work you rightfully did. I don't know what kind of financial situation you are in, but might be work consulting a lawyer over. It is not reasonable for you to pay that back and it reflects very poorly on Upwork to ask you to. It is entirely your client's fault and their responsibility to pay it back. If you were a tailor who made wedding gowns, for instance, and a bride's credit card turned out to be bad, YOU ARE STILL OWED THE MONEY FOR THE WORK YOU PERFORMED. In no way would you owe the bride money for the dress you poured hours of time into. I just can't think of a single scenario where it makes sense for you to pay that back. Sorry if my comparison is stupid, I'm just outraged in your behalf!