Need help with $6500 Excess Contribution made in 2017. Amending 2017 Return but "P" Code is indicating "Taxable in 2016."

TurboTax says I need to amend my return for 2017.  The Code P is saying that they were taxable in 2016.  They didn't earn earnings until 2017.  My 2017 contributions were reversed before the filing date in April, 2018. 

Update:  I did amend my 2017 return as I understand that I am supposed to in order to report the earnings.  The 2018 1099R that I received in 2019 has the Code PJ.  When I entered this code into my Amended 2017 tax form, "P" now stands for Taxable in 2016, which I don't think is right, but I didn't change the Code.

Any help is appreciated.