My 4wd was acting up. Would jump from 2wd to neutral and sometimes 4wd hi. Service 4wd message etc...
Pulled it into the shop. Dropped the driveline. Pulled off the encoder motor. Opened up the encoder motor and swapped out the position sensor. Put it all back together with a new gasket/seal and all is great again.
Sensor+seal = $60
Other options:
Dorman encoder motor $160
GM encoder motor online $359
Stealership parts and labor ~ $900 to $1300
If you have a 04/05 tahoe/Yukon and get these intermittent symptoms and a stored (history) a C0327 code, do yourself a favor and change out the sensor itself and not the whole motor. 90% of the time the motor will loutlast the vehicle. The sensor inside is plastic and akin to a clock-spring mechanically but basically a variable resistor in function and that is what the actual issue is. The Transfercase Control Module cannot figure out where it is engaged and throws errors and wont allow engagement at times.