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 Cover Removal/Installation [Vehicles Without Power Seat System]
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 ...
Rear Bumper Removal/Installation
4SD
1. Disconnect the negative battery cable..
2. Remove the rear combination light..
3. Remove the fastener A and screw B.
4. Remove the rear splash shield..
5. Remove the screws C.
6. Remove the bolts D.
7. Affix the protective tape to the position shown in the figure.
...
ABS HU/CM Removal/Installation
WARNING:
If the ABS HU/CM configuration is not completed, it could result in an unexpected
accident due to the ABS being inoperative. If the ABS HU/CM or ABS CM is replaced,
always use the automatic configuration function so that the ABS operation conditions
are correct.
CAUTI ...