Not necessarily, although there are circumstances where it may be quicker and easier for you to fly back to your home country in order to regularise your status.