Praise be to Allah, the Lord of the Worlds; and may His blessings and peace be upon our Prophet Muhammad and upon all his Family and Companions.
If someone stops his journey and about to start it again, and the prayer time of the prayers that could be joined together (i.e. Zuhr and Asr, or Maghrib and Isha) enters, then he can pray them jointly at the beginning of the prayer time, i.e. to pray Zuhr and Asr at the time of Zuhr, or Maghrib and Isha at the time of Maghrib.
It is permissible also for him if he is in his journey, to continue his journey, and when he stops his journey he would pray the two prayers jointly at the time of the second prayer.
Ibn Abbas narrated saying: "Shall I not inform you about the prayer of the Prophet (Sallallahu Alaihi wa Sallam)? He used to pray Asr in advance jointly with Zuhr, if the starting time of Zuhr had begun while he was still at home (before travelling). However, when he used to travel before the time of Zuhr, he used to delay Zuhr until the time of Asr and then prayed them jointly at the time of Asr. He used to do the same in relation to Maghrib and Isha."
This is easier and more convenient for the traveler. When a traveler arrives at his home and his journey ends, then he is not allowed to shorten the prayer after that. Shortening the prayer is while travelling only. Except, if the time of the prayer has already ended, like Isha prayer for instance, and he arrived after the time of Fajr started, in this case it should be performed as Qada prayer (performed as if it was a missed prayer) as when travelling; this is the view of some Fuqaha.
On the above grounds, what you did is the correct way, if you arrived after the starting time of Fajr prayer, and you started your journey before sunset.
Allah knows best.