I had the same problem about a month ago, the dealership ended up having to replace the actuator, the transfer case control module, and wire harness.
Mine decided to lock up in 4wd when we were about 50 miles away from home. I know the dealership recommended me to tow the truck, but it happened in the middle the night and I wasn't going to wait for one, so I drove it home.
I probably put unnecessary wear on tires and other mechanical parts driving on pavement locked in 4wd, but the truck still drives fine.