possible limp mode problem, C180K

The other day my wife's car suddenly refused to shift out of 2nd or 3rd gear, not sure which. It also felt underpowered, although this could be due to the gear it was in. On the dash the gear was in 'D' and I could not manually down/up shift using the Manual mode, and neither could I put it into 'C' mode, it was stuck in 'S' mode. I parked the car up and put it into Neutral then back into Drive and felt what I can describe a loud Thud in the back. This was repeatable when tried again. It was only when I switched the engine off and back on that the issue disappeared and all the issues I have described above where rectified. My wife has mentioned that this has happened before.

Could someone please shed some light on this? Car in question is a 2005 C180k Sports Coupe. Full service history however I think its been a while since the auto box oil was last changed, could this be the problem?

In regards to my post above, the car now has a permanent engine light on dashboard and is sounding very rough on start up. On top of that it seems to pull off in 2nd gear and doesn't shift up or down. Any one experienced this or know what could be wrong? I have it booked in with a garage next week 15 miles from home, will it be safe for me to drive it there?

Took it to an indie and got it on star. Gear box problem was down to a faulty speed sensor on the conductor plate under the gear box. Rough idle was a split breather pipe under the air box. Both the conductor plate and breather pipe was replaced and now bk to normal.