I have been fighting the same problem with my 05. It started about a year ago occasionally going into limp mode and throwing a P1776 code. It seemed to happen when it was hot out or when I was doing some slower trails where the transmission would get hot. Usually if I turned the engine off and then started it back up it would cycle through the gears fine one time and then back into limp mode, until the transmission cooled off a little then it seemed to work fine. About 3 or 4 weeks a go it got worse and would go into limp mode every time I drove it more than 20 or 30 minutes. Sense then I have invested a lot of time in research to figure out what exactly was going on with it and and I believe I have fixed it. I don't have a lot of miles on it yet, but it has been working very well.
What I found with the P1776 (Solenoid Switch Valve Latched in LR Position) is it is ether a bad solenoid pack, the actual switch valve getting stuck in the valve body of the transmission ether from ware or from contaminants or a damaged wire in the harness. I found a good transmission shop and was able to talk to one of the technicians and he told me that when he sees this problem, 50% of the time the solenoid pack is bad and 50% of the time its the switch valve getting stuck. What I ended up doing is dropping the pan on the transmission and removing the valve body assembly and taking it to this transmission shop. They were able to vacuum test the valve body for leaks and determined that the bore the switch valve rides in was worn out which will cause the switch valve to stick. You can buy an oversized switch valve from Sonnax or Transgo to fix this, but because I had some other leaks I decided to go with a remanufactured valve body from Sonnax. While I was in there I installed a new solenoid pack and a shift kit from Transgo. I also very carefully inspected all of the wire harness from the transmission to the PCU to ensure it was all good. I had previously installed a transmission temp gauge and with this fix the transmission runs cooler.
For what it's worth I hope this helps.