(I didn't know what bug category to put this in so I apologize if this thread is in the wrong spot)
So I was walking through Rock Tunnel and I walked in the path of a trainer (Hiker Eric) and did the little "!" thing. In the same spot a wild encounter spawned and once i killed the wild Pokemon the trainer had walked up to me but did not trigger a battle as if the wild battle substituted for it. Afterwards the trainer was able to battle again.