As per Know Your Customer (KYC) legislation to help governments prevent money laundering and fraud, refunds must be processed on the same card that was used for the payment.
If this card is no longer active or your account is closed, once the funds are deposited into the account, you can contact your bank and check what your options are to withdraw the funds.
If your card has been reported as lost or stolen, the funds will be automatically transferred internally by your banking institution into your new credit card.