I don't trust generic P-codes to always be accurate, but....
As someone who has had this issue before I will give you all the places to look.
1. Interlock cable @mechatronic gearshift.
2. Magnetic reed switch on the valve body mechatronics. (if lucky cleaning will fix)
3. Solenoid and valve body seals.
4. Shit luck and it's a crack in the valve body channels allowing pressure bleed over.
A scanner like the Foxwell nt-510 or nt-520 (200 USD) will show you more data and what your gearshift is in vs what the transmission is in. A difference between the two will give you the symptoms you described, some of the fixes are easy, some cheap and some completely peg your fun meter...
Here's some pics of the different repairs I had to do, but missing the gearshift and reed switch pics.
Also be very very gentle with the gearshift cover as the tabs break easily and over tightening the shifter will put some gears out of position enough to not engage.
https://uploads.tapatalk-cdn.com/202...3fd0bcf7cc.jpghttps://uploads.tapatalk-cdn.com/202...99745dca1b.jpghttps://uploads.tapatalk-cdn.com/202...474317b085.jpg
Sent from my SM-A528B using Tapatalk