Anything is just a guess BUT these trucks (99 to 05) had a lot of electronic problems (shoddy Delphi parts) with switches, instrument clusters, transfer case motors etc. The dash switch has been a big problem and its by far the cheapest and easiest part to replace. The other two electronic parts associated with the 4x4 system are expensive and you just don't want to replace them unless you know they are the problem. There is one under the dash and a motor in the TC and they can run up to $400.
If you want to take a chance on $50 (or less), replace the dash switch. If that does not work, then it might be wise to bring it to a dealer for problem diagnosis.
I had a 2001; One day the truck would not switch out of 4x4, lights would blink for 2wd but would not engage even turning off and starting again, stuck in 4x4. GMC dealer replaced a dash switch first as they were 100% sure it was that (probably because they could get that part same day from another dealer nearby), that solved nothing, then they replaced the tc motor and some other electronic part related to the AUTO 4x4 system (had to order the parts VIP). I was under warranty but I recall the parts guys telling someone there about how much the tc motor was and $400+ sticks in my mind. That was about 8 yrs ago and the truck had low miles at the time of the problems. 2001 GMC SLT E.Cab Z71
Mike
2010 GMC Sierra E.Cab SLT Z71 All Terrain