We stoned the jamaraat on the twelfth day (of Dhu’l-Hijjah), then we left Mina before sunset, intending to leave early. Then we returned to Mina in order to do some things. Are we regarded as having left early or do we have to stay overnight and stone the jamaraat again?.
You are still regarded as having left early, and you do not have to stay overnight or stone the jamaraat again after having left early.
Shaykh Muhammad ibn Saalih al-‘Uthaymeen (may Allaah have mercy on him) was asked:
If the pilgrim leaves Mina before sunset on the twelfth day with the intention of hastening on and he has some work in Mina to which he will come back after sunset, is he regarded as having hastened on?
Yes, he is regarded as having hastened on because he has finished Hajj, and his intention to return to Mina to do some work does not mean that he cannot hasten on, because his intention was to come back for that work, not to come back for Hajj rituals.
Al-Hajj wa’l-‘Umrah, question no. 10.