Hi Im Larry Crow an ASE Master Tech and shop owner for 23 yrs.
I have seen this same problem before, the transfer case shift motor has a position switch built into it and the switch will fail and will no longer be able to operate the motor.
The switch is part of the transfer case shift motor so replace the hift motor assembly and you should have 4WD again. This is a wiring diagram I thought might be helpful to you as well. If you need more help just ask.
thanks again for using justanswer.com
P.S. after hitting the accept button please leave positive feedback. hank You!