If the selector lever will not move from P using the proper shift procedure, continue to hold down the brake pedal.

Take the vehicle to an Authorized Mazda Dealer to have the system checked.
Shift-Lock System
Manual Shift ModeFront Seat Back Trim Removal/Installation
WARNING:
Handling a front seat (with built-in side air bag) improperly can accidentally
operate (deploy) the air bag, which may seriously injure you. Read the service
warnings before handling a front seat (with built-in side air bag)..
CAUTION:
After removing a front seat ...
Crankshaft Position (CKP) Sensor Inspection [Mzr 2.0, Mzr 2.5]
Visual Inspection
CAUTION:
When foreign material such as an iron chip is on the CKP sensor, it can cause
abnormal output from the sensor because of flux turbulence and adversely affect
the engine control. Be sure there is no foreign material on the CKP sensor when
replacing.
...
Charging tips
This section provides practical guidance on how to efficiently use
the charging system of the Subaru Solterra, as well as how to monitor and interpret
important charging-related information for optimal performance.
Systematically charging
To maximize the usability and convenience of the Subaru ...