Multiple years of ineligible Roth IRA contributions

I found out in 11/2022 that I wasn't eligible for the Roth IRA contributions I made in 2017-2021. I was also not eligible in 2022, but thankfully I did not contribute. This mea culpa was due to me not paying enough attention to change in my income after changing jobs. As soon as I realized this, I filled out Vanguard's excess contribution removal form for each year and they moved the contributions to a nonretirement account. I received a 1099-R (Box1: total contribution amount that was removed, Box2a: empty, Box 2b: checked, Box 7: J).

From reading the related community posts and IRS form instructions, I think I understand what I have to do but I just wanted to run through. Please let me know if there's any errors. Hopefully, this will also help others in the future.

  • Amend 2017 with 5329. Paying 6% tax on the excess contribution from 2017.
  • Amend 2018 with 5329. Paying 6% tax on the excess contribution from 2017+2018.
  • Amend 2019 with 5329. Paying 6% tax on the excess contribution from 2017+2018+2019.
  • Amend 2020 with 5329. Paying 6% tax on the excess contribution from 2017+2018+2019+2020.
  • Amend 2021 with 5329. Paying 6% tax on the excess contribution from 2017+2018+2019+2020+2021.
  • Each amended return would be mailed in a separate envelope
  • File 2022 with 5329 and 8606
    • 8606 Line 19: total distribution from 1099-R Box 1
    • 8606 Line 22: Net contributions to Roth IRA since it was opened over a decade ago
    • 8606 Line 23: 0 because the distribution was less than the total contribution
    • 5329 Lines 1-4: empty because there's no tax for withdrawing contributions from Roth IRA  (i.e. no double taxation)
    • 5329 Line 18: total excess contributions from 2017-2021
    • 5329 Line 19: 0
    • 5329 Line 20: total distribution from 8606 Line 19
    • 5329 Line 22-25: 0 because the excess was withdrawn before end of 2022
    • No 10% tax on early distribution for federal or state and no 6% tax on the excess contribution for 2022