Is this the only unusual operating behavior you have noted? When they unlock on their own, can you lock them with the key by turning it to the lock position, or do you have to cycle to the open position and then back to the lock position?
The older W123 series cars have a vacuum operated central locking system that predates the system in your car. In the older car there is no electrically operated vacuum pump to run the locks. Instead, the Diesel models have a vacuum pump driven by the engine and the vacuum is "stored" in tanks so the locks and brakes, as well as the automatic transmission shifting controls work as soon as you get in and start the engine. In this system, the vacuum also is used to shut the fuel supply to the engine off when you turn the engine off with the key. If you get leaks to the portion running the locks, it is common to be unable to shut the engine off from inside the car, as there is no vacuum available to energize the shut off valve actuator. So, a not so unpopular solution for cheapskates like me is to disconnect the door lock system and plug the lines to restore the functionality of the key shut off device. If you do this (plug certain lines to and from the door locking system), it is possible for the trapped air volume, in an otherwise inert central locking system, to open the locks on the doors as the car sits in the sun and warms up.
So, you may have some sticking check valves or other, crimped or collapsed connectors in the system that are trapping a volume of air that the system intends to have evacuated. Once the trapped air expands due to heating, it is possible for the differential pressure generated to energize the door lock actuators. I know this is a bit of a stretch, given the symptoms you described, but I thought I would pass it along anyway.
I hope this helps, and good luck, Jim
1986 Euro 190E 2.3-16 (291,000 miles),
1998 E300D TurboDiesel, 231,000 miles -purchased with 45,000,
1988 300E 5-speed 252,000 miles,
1983 240D 4-speed, purchased w/136,000, now with 222,000 miles.
2009 ML320CDI Bluetec, 89,000 miles
1971 220D (250,000 miles plus, sold to father-in-law),
1975 240D (245,000 miles - died of body rot),
1991 350SD (176,560 miles, weakest Benz I have owned),
1999 C230 Sport (45,400 miles),
1982 240D (321,000 miles, put to sleep)