D&R the battery with wheels straight should fix the issue. Toyota and Honda calls for a steering angle sensor calibration every time a battery is disconnected on any of their vehicles. I suspect there are millions of vehicles on the road with the sensor a few degrees off.
I think the issues really start around 2015 when ADAS systems become prevalent.
In this specific case, Mazda calls for the i-Stop (automatic engine start/stop) to go thru a learn procedure every time the battery is disconnected. It looks like the procedure is designed to teach the start/stop system normal operating battery voltage so that the system knows when battery voltage is too low and shut the sytem down. The windows and sunroof will also lose memory and not function auto up/down until relearned.
The i-Stop initialization procedure is as follows. I pulled this from ALLDATA
BATTERY CONDITION INITIALIZATION SETTING (i-stop SETTING) [(US)]
SM3034145
id0117008010u5
Caution
• If the engine is started with the hood open, i-stop will not operate until the hood is closed and the engine is restarted (Not system malfunction). If the engine was started with the hood open, switch the ignition OFF, close the hood, and then restart the engine.
×: Applicable—: Not applicable
Purpose
Operation
1. Have the PCM learn the battery condition.
1. Connect the negative battery terminal and wait for 10 s or more. (See NEGATIVE BATTERY TERMINAL DISCONNECTION/CONNECTION [(US)].)
2. Close the hood.
2. Perform idle air control learning.
1. Switch the ignition ON (engine on).
2. Turn off the following systems to which electrical load is applied.
• Lighting systems such as headlights.
• Climate control system
• Rear window defogger
3. Warm up the engine completely.
4. Switch the ignition OFF.
3. Verify the i-stop control settings.
Perform the following procedure from Step 1. to Step 5. within 25 s.
1. Switch the ignition ON (engine off) and within 5 s, press and hold the i-stop OFF switch for 3 s or more.
2. Verify that the i-stop warning light (amber) is on.
3. Switch the ignition ON (engine on).
4. Verify that the i-stop warning light (amber) illumination changes to the i-stop indicator light (green) flashing.
• If the i-stop warning light (amber) illuminates or flashes, perform a battery inspection. (See BATTERY INSPECTION [(US)].)
5. Press and hold the i-stop OFF switch for approx. 3 s.
6. Wait for 30 s while idling (with no electrical load).
7. Perform engine racing for a minimum 10 times and a maximum 20 times. Then, wait for 30 s while idling (with no electrical load).
• After the flashing i-stop indicator light (green) turns off, switch the ignition OFF.
• If the i-stop indicator light (green) does not turn off, it is possible that there is a problem with the Mazda M Hybrid system, therefore, perform an inspection of the Mazda M Hybrid system. (See DTC INSPECTION.)
Note
• Depending on the battery condition, the i-stop indicator light (green) may stop flashing and turn off early, and the i-stop control setting verification may be completed early.
8. After the flashing i-stop indicator light (green) turns off, switch the ignition OFF.
4. Perform an i-stop control operation verification.
1. Switch the ignition ON (engine on).
2. Accelerate to a vehicle speed of 15 km/h in approx. 5 s without operating the steering wheel.
3. Stop the vehicle.
4. Verify that the engine stops and restarts by the i-stop control.
5. Switch the ignition OFF.