Your vehicle has a transfer case shift position sensor that is located on the side of the transfer case. If the sensor is faulty, it will not know it’s 2 from it’s 4’s, it’s 4’s from it’s lows, etc etc.
The shift position sensor is round & located on the back of the transfer case with wiring going to it. The wiring splits into 3 connections that go to the ECM. Two 8 wire connections & 1 5 wire connection.
By measuring resistance at each circuit, a tech would be able to determine where exactly the fault lies. My guess would be that your problem would be electronic. If diagnoses reveals replacing the sensor is needed then I would assume your problem should cost you a few hundred at the most. Diagnoses is the key. A good shop should be able to electronically identify the shop in a short period of time.
The only exception I can think of is if a short in the wiring exist between the ECM & the transfer case. It could take awhile to locate the short. The wiring harness runs all the way from the transfer case all the way up into where the ECM is.
Good luck.