The bank will reject the direct deposit since the account is closed. The federal tax refund is sent back to the IRS. The IRS will send you a refund check in the mail to the address you entered on your tax return.
When the deposit goes to the closed account, the bank will send it back to the IRS. Then the IRS will mail a check to the address you entered on your tax return. Is that address correct--or do you need to change your address with the IRS?