The sudden Battery Charging failure happened to me too a few months ago on my 2020 ND2. Reached my destination ok (30 minutes drive at night) and it went away after restarting the car. I checked the battery voltage after I arrived and it was 12.6V, meaning it must have still been charging on the journey. Subsequently invested in an OBD reader and found the P2502:00 code logged as a non-active fault.
So far it’s only happened once, but I’ve been digging into it to be prepared if it should happen again. One of the things I’ve discovered is the online MX5 ND manual doesn’t apply to the ND2 with i-ELOOP and P2502 has a different meaning. The Mazda 3 online manual has the i-ELOOP version of P2502 (scroll down):
https://mazda3.neocities.org/esicont/srvc/html/id0102h9709500
P2502 with i-ELOOP means “Battery voltage is 11 V or less and condition in which current sensor detects battery charging for specified period continues”, in other words the current sensor indicates the battery is being charged, but the voltage is measured below 11V for at least 5 seconds.
In my case, the battery seemed to be working normally when I started the journey (i-STOP working, and no problems turning over the engine) and measured normal after driving for 30 minutes with the battery charging failure.
I’ve ruled out obvious problems like loose connections. To me this points to either a software problem or a glitch in measuring the battery voltage. I don’t see how the DC-DC converter could be responsible because if it suddenly stopped working the battery would stop charging and a different code would be logged. This specific code is only logged when the battery IS being charged, but the voltage is much lower than it should be.
I’ll update the thread if it ever happens again - I’m now armed with the OBD reader and a multimeter in the car!