Volvo S40 shifting issue

I have a 2002 Volvo S40 1.9T automatic. Ever since I bought the car used with 14,000 mi on it in 2003 it has had a strange intermittent problem. Occasionally when I start it up after it has been sitting for several hours, after I have driven it a mile or so but less than 2 or 3 miles, when it upshifts (I’m guessing from 2nd to 3rd gear but it could be fron 1st to 2nd) it behaves as if the transmission disengaged from the lower gear and for a couple of seconds did not engage the higher gear. I get a feeling that the engine is surging but the car is slowing down. Then it catches and everything is OK. Once it is warmed up, this does not happen. It occurs most commonly when the Phoenix weather is hot, but I have also had it happen when it is cold (for us) outside - low 40s. If I take it where it is truly cold, it does not do this that I have ever encountered. I gave up asking the dealer about it because they say they cannot reproduce the problem. Any ideas?