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 ModePilot Bearing Inspection [G66 M R]
1. Perform the following procedures.
a. Remove the battery cover..
b. Disconnect the negative battery cable.
c. Remove the battery component. (ex: battery, battery tray and PCM component).
d. Remove the air cleaner component..
e. Remove the exhaust manifold insulator installation bolts an ...
Sunroof Unit Disassembly/Assembly
NOTE:
If the guide or sunroof motor is removed, the glass panel will not be positioned
properly after the re-installation. To ensure proper positioning of the glass
panel, place alignment marks on the guide pin and frame before removing the
guide or sunroof motor.
1. Disassemb ...
Passenger Compartment Temperature Sensor Removal/Installation [Full Auto Air
Conditioner]
1. Disconnect the negative battery cable..
2. Remove the following parts:
a. Front scuff plate.
b. Front side trim.
c. Dashboard under cover.
d. Upper panel.
e. Shift lever knob (MTX).
f. Selector lever knob (ATX).
g. Shift panel.
h. Side wall.
i. Console.
j. Hood release lever ...