I don't recall seeing this problem posted here but here goes...My 240D was showing signs of drastic loss of power. There is a slight uphill to exit my driveway and many mornings I could barely make it up it. Once I reached the top though, the car seemed to gather itself and recover. It did this nearly every time. It also seemed to hesitate any time I was at a stop light situation and just take forever to get up to a proper speed making a dangerous situation getting onto the highway or going across traffic. I initially looked at the engine and went through the basics...vacume, filters, had injectors tested, fuel line etc...
The fix was much more simple than that though. When cleaning the interior one day, I decided to pull out the drivers floor mat and leave it out. After that, the gas pedal was able to make better contact with the 1st gear kick down switch and made an immediate difference! I guess, the lugging it was doing was the car trying to start out in a higher gear and just not generating the rpms to create speed.
The car once in awhile will still do this and am wondering if it is the beginnings of a switch failure. Is this switch mechanical or electrical in nature? does it need cleaning or lubrication?
Hope this helps someone experiencing the same problems I had.