Is there a way to avoid that ? I really don't know
But when it does happen edit the datum plane and flip the normal (under Plane Orientation, reeverse direction) and that should fix it.
While this thread will NOT directly address your issue, it does go into some length, particularly the second to the last entry, in explaining why certain behaviors are seen when editing sketches, and to some extent, how you might avoid them: