I've never experienced that before myself. It is probably a bug, in which case you should report it to the game makers (they tell you how to do so on the front page of this thread).
However, before doing so, check that the pokemon that repels wild animals at the front of your party isn't...