W212 Gear Selection Problem( the gear automatically shifts to P from N, R or D)

I have a mercedes benz e250 cdi 4matic which calls w212 and whose model year is 2012. I have a problem with the gear selection which is that the car automatically (by itself) shifts to P from N, R or D while moving at 0 to 8 km/h or not moving. Firstly, I went to a mercedes authorized service, and they checked the car and they updated the gear selector and they said that it is okay, but the problem continued.
1)It has no fail code so it shows that everything works properly.
2) Generally, after the car goes 20 kilometers(11 miles) or higher, i stop the car and then again start and then the problem is existed. In other words, when i start the engine again the problem is existing.
3) The gear shift to p from N,R or D three or four times. For example, I shift to D or R or N but the gear automatically shift to Park then again i shift to D or R or N but again the gear automatically shift to Park Then, the gear is not automatically pass to Park. Therefore the car works perfectly after making the shifting to p three or four times.
After that, i went to another mercedes authorized service, serviceman says that the problem can arises from left door lock or ignition. It makes sense, because when the key is removed or the left door is opened, gear shifts to P.
My observations and experince are that when the gear shift to P, it has no warning like door is open or the top light is open. I use my spare key but the problem has not been solved.
I hope you can help me. Sorry for long writing. Thanks you a lot in advance.