Sunan Abi Dawud Book 5, Hadith 17
The Messenger of Allah (ﷺ)as saying: When the iqamah is pronounced for prayer, no prayer is valid except the obligatory prayer.
A man came while the Prophet (ﷺ) was leading the people in the dawn prayer. He prayed the two rak'ahs and then joined the congregational prayer led by the Prophet (ﷺ). When he finished the prayer, the Prophet (ﷺ) said: So-and-so, which was your real prayer, the one you prayed alone or the one offered with us ?
The Messenger of Allah (ﷺ) saw a person praying after the congregational prayer at dawn was over. The Messenger of Allah (ﷺ) said: There are two rak'ahs of the dawn prayer (i.e. the prescribed rak'ahs). The man replied: I did not pray the two rak'ahs before the dawn prayer. Hence I offered them now. The Messenger of Allah (ﷺ) kept silent.