I don't think anything is wrong with the transmission itself.
Its sounds like you are just losing the OSS sensor signal, if you have already replaced the sensor I would think it could be the connector or wiring. A scanner that can read the data stream can help catch the glitch and you can use it to find the failure by moving and pulling on the wire harness and connector while watching the scan tool for the drop in signal. Obviously it would help to have a lift it being a AWD but maybe you have a option for neutral on the transfer case, not sure about that.