Retirement tax questions

The plan will issue a form 5498 to you with a copy to the IRS, which reports contributions and rollovers.  The IRS is (theoretically) able to match the 1099-R from the 2020 withdrawal, the 5498 from the 2021 repayment, and your tax returns.