As old skull says it may be the cable has become disconnected
But more common is a problem that is asked about weekly. I tried the search function for a recent post about sticking in 4wd but there was no joy
This is a common "situation" with the NV242 transfer case our CRD's came with.
What works for me is put it back in full time 4wd then while driving stright shift to 4wd part time for a few hunderd feet then into 2wd.
All 4 tires must be EXACTLY the same with the same air pressure for this transfer case to work properly
The cause is the way the shifting mechanism is designed. When you move the lever your only pushing on a spring. When all is aligned the spring might push the shift fork into the desired selection.
This is not a CRD specific problem and the "general" section might be a better place to look.
Joe