Sounds like a timing issue between the time the DIR line changes state and the time the first step pulse is sent. Most stepper drivers require a minimum time (5 micro-seconds on mine) from the time the DIR line changes before a step pulse can reliably be applied. If the step pulse arrives too soon, the first pulse (or even two perhaps) will spin the motor in the wrong direction. Since it is happening only when switching from forward to reverse, I'm guessing your system is probably using a low signal for the forward direction (active low) and a high for the reverse direction. I say this because a system can often sense a low (ground/reference level) quicker than it can sense an applied voltage.
I'm not sure how to adjust this since my system is off-line at the moment, but perhaps someone else will chime in on what to change/set to adjust this timing. But I'm pretty sure that is what is happening at the very least.
Stephen "Highspeed" Kruse