the alternator can fail in one of 2 ways. it either has reduced output, which runs the battery flat, or it produces too much output (faulty voltage regulator) which cooks the battery. either can cause the engine to stall, and either problem could cause the key code light to come on. the immob is sensitive to voltage changes. if the starter motor couldnt turn the engine due to insufficient battery charge, it would also suggest the alternator could be the problem. a quick test with a multimeter can tell you what the alternator is doing. i hope the garage have actually tested the alternator before recommending its replacement. i would have preferred to fit a scrapyard alternator (£10-20). its easily replaced.