Retirement tax questions

No - P is for 2018 if returned in 2019.    The interview asks what year the 1099-R is for and when you say 2019 the year advances by one so it is taxable in 2018, not 2017.   Code P is correct.  

A code 8 means it was a 2018 contribution returned in 2018 which is was not or you would have received a 2018 1099-R.
**Disclaimer: This post is for discussion purposes only and is NOT tax advice. The author takes no responsibility for the accuracy of any information in this post.**