Changing on the fly isn't recommended, but it hardly ever fails if things are working well.
1) There is only ONE transfer case, and it's on the rear of the transmission. Its fluid needs to be changed every 50K miles. Are you current on that?
2) There are two DIFFERENTIALS, to be changed usually every 100K. Old fluid wouldn't cause your symptoms.
3) The switch probably isn't bad, but the way to diagnose that is if your desired mode is lit up on the switch above the selector. The switch is bad if the mode light DISAGREES with the switch position.
4) VERY IMPORTANT to troubleshoot this is to observe the lights as you change the mode switch. Only change it ONE mode at a time, so your first change should be (you can do this while stopped with the engine off even, but the ignition in RUN) from 2HI->A4WD mode. As you change the switch, the light over 2HI should be steady, and then the light over A4WD should blink for a few seconds then go steady. Does it? As that's happening, you should hear TWO motor noises from underneath the vehicle. Memorize these. One is a high-pitched whine that goes for a second or just a bit longer. That's the front axle actuator. The other is lower pitched and shorter duration. That's the transfer case encoder motor.
5) Then change modes from A4WD->4HI. The front axle actuator is already engaged, so you won't hear that noise again. You should ONLY hear the transfer case encoder motor, and the mode switch light will flash over 4HI and then go steady when the TCCM gets the expected position feedback signal.
5) What usually fails is the front axle splined disconnect on the passenger side of the oil pan, assuming you don't get any flashing mode lights on your switch, or the "Service 4WD" light on your dash. Here's links to more reading on troubleshooting or rebuilding that unit:
Offroadtb.com Diagnosing the 4WD System
Offroadtb.com Front Axle 4WD Disconnect
Transfer case theory of operation:
Offroadtb.com Transfer Case Operation: NVG 226 (NP8)