What year was the contribution for?
If 2020, then if you filed your 2020 on time before May 17,2021 you have until Oct 15, 2021 to have the contribution *and any earnings* as a "return of contribution" (not an ordinary distribution), then only the earnings will be taxable.
The contribution was made in 2021 but for the 2020 tax year.
The 2020 return was filed on time.
You have until the due date (or extended due date) of the 2020 tax return to get the return of contribution plus earnings. Filing on time gives you an automatic extension to Oct 15, 2021.
If you took a deduction for an IRA contribution that you are reversing, you have to file an amended return.
You can add also the "amount of earnings" with that if you are acting timely.
the custodian must calculate the earnings.