Still working on figuring out what combination of circumstances caused the problem, I turned to the last resort - consult the manual!
On page 18 it deals with the key/immobiliser functions. What I found interesting was that it states that the unlock button unlocks only the driver's door, not the other doors. Yet all the doors, including the rear split doors unlock with the button.
I opened the passenger door before opening the driver's when the fault occurred for the first time after unlocking the car. As mentioned, I don't usually lock the car when it is garaged so the battery is not run down during long periods of inactivity.
Interestingly, both my Mazdas require their immobilisers to be activated when the cars are not in use so that the batteries don't run down.
I repeated my procedure before the fault occurred as best I could remember it just now to test the door sequence theory but the engine leapt into life as usual. Go figure.
But it's good that nobody has said that the problem has persisted and immobilised the car permanently.