Phase retrapping in aφJosephson junction: onset of the butterfly effect