If you entered the correct account and routing numbers, but the IRS made an error in depositing your refund, you should contact the IRS as soon as possible. The IRS will correct any agency errors. Specifically, you should call an IRS customer service representative at 800-829-1040 to address the issue. Once the error is confirmed, the IRS will issue a paper check for the refund amount. This process ensures that you receive your refund despite the initial error in the direct deposit.
Sources:
Publication 17 (2023)