The greater the headwind, the greater the lift produced by the spinning ball, thus the greater the distance produced. Could easily be greater than the loss of distance due to the air mass moving in the opposite direction. The direction of lift is also a function of angle of incidence of the wind's vector on the ball, which clearly affects distance as well. However, all this may not be repeatable, as the spin of the ball may not be consistent. It's essentially what we baseball fans know as a "knuckleball", that is a ball that is propelled without consistent control of the direction and amount of spin. It could go anywhere, at any time, as many batters have learned the hard way.