The 7-speed automatic in most Mercedes with V6 and V8 engines from 2004 on is the 722.9. Mercedes calls it 7G-Tronic. The weak part on the early ones is the conductor plate.
The conductor plate sits inside the transmission, on top of the valve body. The transmission computer and the speed sensors are on this one plate. Mercedes does not sell the sensors alone. When one sensor fails, the plate gets changed.
When the plate goes bad you get hard shifts, late shifts, or a long wait when you put it in Drive or Reverse. Then the warning comes on and the car stays in second gear. Turn it off and on again and it can shift normal for a while. Sometimes this goes on for months before it fails for good.
In the fault memory you usually see the speed sensors, Y3/8n1, Y3/8n2 or Y3/8n3. I still check the wiring, the connector and the fluid first. Not every speed sensor fault is the plate.
A new plate from Mercedes does not just plug in. It has to be programmed and coded to the car first. A lot of independent shops cannot do this part, so the car goes to the dealer. I do the programming, coding and adaptation here, and then I drive the car until it shifts right.
On high mileage I do not stop at the plate. I check the valve body and the solenoids, change the filter and the pan gasket, fill it with the correct fluid and update the software.
Mercedes sold the early 722.9 as filled for life. Transmission fluid is a consumable, the same as engine oil. When the factory says lifetime, ask what lifetime means. I learned this from the design engineers at SEMA. Lifetime means 120,000 miles. If you want your transmission to last much longer and work at its best, change the fluid every 40,000 miles, 60,000 at most.
Clearing the codes does not fix it. The fault comes back. If your Mercedes shifts hard or goes in limp mode, bring it. I will tell you what it is before we change any parts.