Excess Roth Contribution

Made a contribution for 2020, turned out to be excess.  Withdrawn in 2021.  Received 1099-R in 2022 showing 2021 1099-R with gross distribution and taxable amount.  TT says need to amend 2020 return.  In amending 2020 return when I enter the 1099-R with codes J and P, P is:  Return is taxable in 2019!!  Do I leave P off the box 7 codes or ????