I worked for a dealer and most of them are shooting in the dark nowadays because everything is computer controlled and if the computer can't diagnose the vehicle, they have to rely on the fixes others have found (basically what everyone does here too)
12 error code means there is a high chance that something caused and extreme power drop (lights left on, jumps starting another very dead car, etc) may have triggered it, BUT it can also be loose or corroded connections (if you pull the cable off, and wipe your finger through the inside and get a grey pasty looking stuff on your finger, that is lead oxide which, unlike lead, is a VERY poor power conduction agent. Clean, dry, shiny metal to metal contact at the battery posts, and power cables that aren't going green inside from corrosion are important.
The main ground connection at the block is infamous for getting "silent" corrosion between it, the bolt and the block which will flex and disconnect while you are driving at certain torque points. I've also had the stock ground cable pull loose from the cable lug on the block and leave just the tiny battery to fender ground lead to do all the work. You would NOT believe how many people will replace their alternator and battery as well as other parts trying to cure a migrating problem without taking the time to diagnose. I have bought quite a few for cheap after offering to repair it for a reasonable fee {they passed, citing "professionals" that couldn't find the trouble, so how could I? 30 years as a mechanic is how} and fixed this minor issue then resold for a decent price.
Last, but certainly not least, a battery with broken internal plates will give this error as well as work sometimes, but not always.