The way it worked in FSX wasn’t correct. In FSX the Cessna 172 equipped with a G1000 had a KAP 140 (which was appropriate back then). Later on Garmin swapped this to a GFC 700. With both you can’t engage a vertical mode (in the case altitude) without a lateral mode. When you do the default lateral mode (roll) will be engaged.