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 ModeRear Seat Belt Removal/Installation
CAUTION:
The ELR (emergency locking retractor) has a spring that will unwind if the
retractor cover is removed. The spring cannot be rewound by hand. If this occurs,
the ELR will not work properly. Therefore, do not disassemble the retractor.
4SD
1. Remove the following part ...
Body Control Module (Bcm) Inspection
1. Remove the following parts:
a. Front scuff plate (LH).
b. Front side trim (LH).
c. Upper panel.
d. Shift knob (MTX).
e. Selector lever knob (ATX).
f. Shift panel.
g. Side wall.
h. Console.
2. Set the hood release lever out of the way..
3. Remove the lower panel. (driver-side). ...
Check Valve (One Way) Inspection [Mzr 2.3 Disi Turbo]
1. Disconnect the vacuum hose connected between the check valve and the purge
solenoid valve from the purge solenoid valve..
2. Disconnect the vacuum hose connected between the check valve (one-way) and
the intake manifold from the intake manifold..
3. Blow through the check valve (one-way) ...