I have excess contribution in my 401k and asked to adjust that. I got a 1099R with box 7 as Code P. TT says that P is "income taxable in 2017" which seems wrong

Considering the current year is 2019 that I put all this money into the 401K in the year 2018 why is this money considered taxable in 2017?