It is important to take note of the codes the mechanic pulled up. They could be body control module (BCM)/anti-theft VATS/Passlock codes relevant to your problem. Post the DTC codes if you have them.
It sounds like you have either a flaky ignition switch key cylinder, a BCM module or wiring causing a loss of serial data.