Welcome to the forum.
Number one, if it has a transmission dipstick check the fluid level. Top up as required.
How exactly do you think that the transmission cuts the engine at idle?
Are you coasting to a stop on the brakes and the engine then cuts out like it would in a manual if you didn't dip the clutch?
If the above is the case, it could be a downshift problem which yes could be due to a faulty solenoid valve or anyone of the other million components in the gearbox. The solenoids are controlled electronically so there could be a fault with anyone of the sensors in the gearbox or if the E34 have wheel sensors (like the E39) it could be one of them at fault.
It could just also be in dire need of a service. If your transmission has not been serviced in 12 years the fluid will have deteriorated and most probably the fluid filter will be partially blocked.
The best thing to do is to take it to an Automatic Transmission Specialist, they will be able to diagnose the fault if there is one and also get the autobox serviced while you are there.
HTH
Andrew