Using a tester, check the continuity of P range switch.
Connector & terminal
(B117) No. 1 — No. 2:
Does continuity change from Continuity ⇔ No continuity according to AT select lever operation?
Replace the P range switch.