You may have a problem with your disconnect acutator on the front axle. It gets fed vacuum from the transfer case to lock the axle shafts togther in. In start the engine and go under the truck. Remove the lines from the disconnect. One should have vacuum. Put it in the other hose should have vacuum. If the vacuum is correct you will need to remove the discconect from the axle and actuate it with a vacuum pump. If vacuum is not ok at the disconnect, check the transfer case supply vacuum at the switch on top.
This sounds like an issue with the transfer case. Is it in neutral? The grinding when you put it in park suggests the transmission is working and the output shaft going into the transfer case is spinning. You're hearing the parking pawl chattering on the spinning drum as it tries to drop into a notch. Normally that drum stops rotating when the driveshaft stops rotating.
the transfer case got bumped into neutral or the shift linkage was not quite solidly in gear. The only other option would be if a chain or gear broke inside it, but then it wouldn't start working again. If this happens again, I would check the adjustment of the shifter linkage. I could envision it getting bent by hitting something while 4-wheeling, but even that would not be common. A loose mounting bracket would be more likely, but as I recall, it is mounted directly to the transfer case.