B0789 Mazda OBD2 may also be triggered by faults earlier down the line. For example, a dirty MAF sensor might be causing the car to overcompensate in its fuel-trim adjustments. As a result, oxygen sensors are likely to report fuel mixture problems.
The crank but won't start condition, along with the trouble codes may make you think you've got a PATS anti-theft system problem. However, Ford reports that these codes are all related to software bugs. The only way around the problem is to reprogram the PCM with the latest software.
The firing order is an important part of the overall design of the engine and is determined during the design of the engine to eliminate as much engine vibration as possible. If the firing order is changed or adjusted, the ignition from the spark plug is delivered at the wrong time and the engine functions poorly or does not run. The firing order for a particular engine is typically found in the repair manual specific to that model.
B0789 meaning and repair processes are the same for all Mazda models.
B0789 Mazda Trouble Repair Process:
If your vehicle failed a B0789 Mazda test and the B0789 Mazda Check Engine Light is NOT on, chances are you have a problem with the OBDII system, a burned out MIL lamp, or a faulty catalytic converter. The converter is essentially an afterburner that cleans up the exhaust after it exits the engine. The OBDII system uses a ownstream oxygen sensor to monitor the efficiency of the converter, and it should detect a drop in converter efficiency if the converter has been contaminated or is failing (ignition misfiring, leaky exhaust valves, and oil burning can all damage the converter). What you want to look any conditions that might cause ignition misfire, an overly rich or lean fuel condition, or loss of compression. Use your OBD Express DIY to look at the oxygen sensor outputs, coolant temperature, airflow, calculated engine load, and inlet air temperature.
b0789 is a very common fault code for the thermostat. If you have this fault it will need to be replaced. I would start with that repair, clear the faults and perform a 30 minute battery reset(disconnect the negative cable off of the battery) and retest the vehicle.