The problem is in the shift fork in the transfer case. Just had a similar problem two days ago with the same symptom.The Shift fork wears out and binds when trying to move gear slide. Transfer case will need rebuild.
You say you've changed the selector switch>? The manual shift transfer case has a shift lever on the floor to engage 4X4.The electronic shift has a 'selector switch'.
If you have electronic shift, then you probably have a actuator motor on the transfer case that may be binding.Let me know if this helps and if you need more answers.
Principles of Operation
Transfer Case — Electronic Shift
The four-wheel drive, electronic shift-on-the-fly feature electrically shifts the vehicle transfer case between 2WD, 4X4, and 4X4 LOW. The system mode is selected by the operator through the mode select switch (MSS) on the instrument panel. The operator is informed which mode the system is in by two instrument cluster indicators, one for 4X4, and one for 4X4 LOW in 4X4 LOW both the lamps are on). Shifts into 4X4 can be made at any speed. When shifting into 4X4 with the vehicle stationary, tooth blockage may occur, preventing shift completion. When the vehicle is driven above 8 km/h (5mph) the shift will complete. When shifting in or out of 4X4 LOW, the four-wheel drive (4WD) control module requires that the vehicle speed be less than 5 km/h (3 mph), the brake pedal be applied, and the transmission in NEUTRAL (automatic transmission) or the clutch pedal be depressed (manual transmission). (The digital transmission range TR sensor informs the 4WD control module when the automatic transmission is in the NEUTRAL range position.)
The gearmotor encoder assembly is mounted externally on the transfer case. It drives a rotary cam which moves the mode fork and the range fork within the transfer case between the 4X4, 4X4 LOW, and 2WD range positions.
The 4WD control module uses two relays to control the gearmotor encoder assembly shift between 4X4, 4X4 LOW, and 2WD modes. The 4WD control module controls the pulse vacuum hublock (PVH) solenoid which supplies engagement and disengagement vacuum to control the hublocks.
The 4WD control module accomplishes shifts by interpreting inputs from:
Based on these inputs, the 4WD control module controls the shifts into 2WD, 4X4, or 4X4 LOW with the following outputs:
The electronic shift-on-the-fly (ESOF) system has a feature which allows the driver to override the vacuum-operated hublocks. When the front hublocks are manually turned to the LOCK position, the hublocks are locked at all times, overriding the vacuum operated system. If the front hublocks are manually turned to the AUTO position, the hublocks can only be locked by turning the MSS to 4X4 or 4X4 LOW position.
Electronic Shift Vacuum Schematic