Verify that the ignition key cannot be pulled out except in P position.
Shift-lock inspection
Interlock cable inspectionMazda 6 Service Manual: Locking, Unlocking the Doors
NOTE
The system may not operate if you are too close to the windows or door
handles.
If the key is left in the following areas and you leave the vehicle,
the doors may be locked depending on the radio wave conditions even if the key
is left in the vehicle.
Around the dashboard
...
Mazda 6 Service Manual: Immobilizer system reprogram procedure
Note
When an error occurs during the reprogram procedures, except when
the PCM is replaced, repeat the procedure from Step 1. If you still cannot
reprogram, confirm how many keys can start the engine. Then, perform the key
replacement or addition reprogram procedure according to the val ...