Mas'alah: If one cannot leave Minaa before sunset, then it is makrooh to leave without ramee (pelting) of the following day, i.e. 13th Zul Hijjah.
It is not waajib to pelt the jamaraat the following day in this case, nor is it impermissible to leave Minaa.
Mas'alah: If one did not leave Minaa before sub'h saadiq the following morning, i.e. the morning of 13th Zul Hijjah, then it is waajib to perform the ramee of that day. Failure will result in dam.
IMPORTANT NOTE: It is commonly known amongst people that one must leave Minaa before sunset on the 12th Zul Hijjah, otherwise the ramee of the following day will become waajib.
This is not so. The ramee of the following day will only become waajib if one delayed his stay in Minaa until sub'h saadiq (dawn) of 13th Zul Hijjah.
Many pilgrims, due to this misunderstanding, try to leave Minaa before sunset and in their endeavour, they either pelt the jamaraat before zawaal (which is invalid altogether) or they wait standing in the scorching heat from as early as 10.00am, so that they can pelt as soon as it is zawaal and leave Minaa before sunset.
In this way, they bear great hardships and put themselves in great danger too, especially their weak ones. They become the cause of harming themselves as well as other Muslim brothers which is haraam.
It is not an easy task to pelt the Shaytaan in the midst of a crowd of hundreds of thousands of pilgrims. Please practice patience and fulfil this obligation, preferably after Asr. If need be, you may delay your ramee until after Maghrib. As long as you leave Minaa before sub'h saadiq, it is fine.
NOTE: Many people, on their way back to Makkah are held up in traffic jam and do not perform Maghrib Salaat. Take care and perform Maghrib wherever you are and also 'Eeshaa once you have returned to Makkah.
"Verily there shall be no reward for a righteous pilgrimage except Jannah." (Bukhaari, Muslim)