2004 Jeep Cherokee - Goes into limp mode

I have an 04 Cherokee Overland with a 4.7 H.O motor. Occasionally my engine light comes on and truck goes into limp mode. Won’t go into first gear or overdrive. If I shut the car off and turn it back on, it is fine again. And after driving for like 30 min the light goes off. This can happen once every couple days, but tends to happen multiple times a day. Sometime I put it in neutral, turn it off and start it while moving and that allows it to go into 1st gear and overdrive. I put an ob2 scanner on it and I forget the code it shows but I remember it said something like solenoid D… I’m hoping I don’t have to change a solenoid pack. I don’t have the money or time to do that. Maybe it’s a smaller issue I overlooked. Any help would be appreciated. Thanks.

Post back when you remember the code.

Tester

Yes, and an option is to have your dealer scan it. My Caravan did similar, the dealer hooked it to his scope and replaced an inexpensive wheel sensor. I ran for coffee before the procedure started and the GF was gone before I got back.