My '91 300E does exactly the same thing and it's done it since the car was brand new. If I have the HVAC on but turn the compressor off, the shifts are acceptable. It I turn the compressor on, the shifts are too hard.
I used to live in Minnesota so it wasn't too much of a problem but now I live in Arizona where we still are having 100 degree days and it's driving me batty.
I'm going to have the dealer fix the da*n thing when I get the transmission serviced.
I'll be interested to see how you resolve the problem.