Tahajjud Prayer is part of the Sunnah of the Prophet (peace and blessings of Allah be upon him) which Muslims are encouraged to follow. Performing Tahajjud Prayers regularly qualifies a person to be one of the righteous people and grants him Allah’s bounty and mercy. Allah says: (Lo! Those who keep from evil will dwell amid gardens and watersprings, taking that which their Lord gives them. For, lo, they were doers of good. They used to sleep but little of the night and before the dawning of each day would seek forgiveness) (Adh-Dhariyat 51:15-18).
Sheikh Ahmad Kutty, a senior lecturer and Islamic scholar at the Islamic Institute of Toronto,Ontario, Canada, states: If you arrive at the mosque before the jama`ah (congregation), you are allowed to engage in nawafil Prayers as you wish. But once the imam has stood up to lead the fard salah (obligatory Prayer), you are not allowed to initiate any nafl, as you are certainly obligated to join the jama`ah. If instead of joining the jama`ah you were to initiate nafl, you are violating the explicit interdict of the Prophet (peace and blessings be upon him) who said, “When the congregational Prayer starts, it is not the time for any other Prayer!”
If, however, you had already started the Prayer and the Iqamah (the call to commence Prayer) was called while you are still at it, then you are allowed to complete the same if you are reasonably certain that you can still catch the imam in the first rak`ah; otherwise, you ought to simply break your salah and join the imam.
Now as far as missed Tahajjud is concerned, if you wish, you can make up for it by praying some extra rak`ahs when the sun has fully risen (that is, at the time of duha or ishraq). Or as some scholars have said, praying a few rak`ahs of duha or ishraq will compensate for the same. Remember, there is no shortage of opportunities for increasing the rewards in Islam. May Allah accept from us the best of our deeds and forgive us all of our slip-ups and trespasses. Ameen.