If a Pokemon with Harvest uses their berry in a wifi battle and is switched out before harvest can activate, when they are switched back in is there a chance of Harvest activating and giving you back that berry?
If the Pokémon has used a Berry, there is a 50% chance of it being restored at the end of each turn. The held Berry is remembered even if it is not restored or if the Pokémon has switched out. Harvest will always activate in intense sunlight. Source.
Yes, Harvest can activate when the Pokemon is switched out.
Source: Above Link
According to Bulbapedia there is still a chance of it still being able to be reharvested.
Hope I Helped.