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 ModePower Brake Unit Removal/Installation [Mzr 2.3 Disi Turbo]
CAUTION:
Once the brake switch clearance has automatically been adjusted, it cannot
be adjusted again. Therefore, replace the switch with a new one when replacing
the power brake unit or performing any procedure that changes the pedal stroke.
Secure the steering wheel using tap ...
Rear ABS Wheel Speed Sensor Inspection
Installation Visual Inspection
1. Inspect for the following:
If there is any malfunction, replace the part.
a. Excessive looseness or play of the rear ABS wheel-speed sensor
b. Deformation of the rear ABS wheel-speed sensor
c. Deformation or damage of the rear ABS sensor rotor
C ...
Trunk Lid Opener Cable Removal/Installation
1. Disconnect the negative battery cable..
2. Remove the following parts:
a. Front seat (LH)(See FRONT SEAT REMOVAL/INSTALLATION.)
b. Front scuff plate (LH).
c. Rear scuff plate.
d. B-pillar lower trim.
e. Rear seat cushion.
f. Rear seat back.
g. Tire house trim (LH).
h. Trunk end ...