Is the system ESOF ( Electronic Shift On the Fly ) or MSOF ( Mechanical Shift On the Fly ) ?
If you have already tested to find the front drive shaft locks into place, and the front axle is the cause, looks to the front vacuum disconnect shift motor.
Item #10 in the parts diagram below :
Close up of it ( this is a picture from another person's bracket that broke ) :
Chances are the vacuum lines to the vacuum disconnect motor are cracked, the vacuum solenoids are not working correctly, or the vacuum to the solenoids is having an issue ( the reservoir ) :
Vacuum diagram for the shift motor
The pink line is vacuum for 2WD operation ( unlocks the axle ) the light blue vacuum line is for 4WD operation ( locks the axle ).
You can test right at the vacuum disconnect motor with a vacuum gauge with the motor running. Unplug the shift motor, and check for vacuum right at the motor.
Could be the shift motor has a damaged diaphragm and not holding vacuum or has water in it ( saw that 1 time ).
Start with checking for vacuum. Also check the fuses for the vacuum solenoids, the power is always at the solenoid, ground is switched on and off by the GEM ( Generic Electronics Module ) to operate them