I attended Fajr prayer with the Messenger of Allah ﷺ in Masjid al-Khayf. When he finished praying, he saw two men at the back of the people who had not prayed with him. He said: “Bring them here.” So they were brought to him, trembling. He said: “What kept you from praying with us?” They said: ‘O Messenger of Allah ﷺ we had already prayed in our homes.' He said: “Do not do that. If you have already prayed in your homes, then you come to a masjid in which there is a congregation, then pray with them, and it will be a voluntary prayer for you." (Using translation from Nasāʾī 858)
شَهِدْتُ مَعَ النَّبِيِّ ﷺ حَجَّتَهُ فَصَلَّيْتُ مَعَهُ صَلَاةَ الْفَجْرِ فِي مَسْجِدِ الْخَيْفِ قَالَ فَلَمَّا قَضَى صَلَاتَهُ وَانْحَرَفَ فَإِذَا هُوَ بِرَجُلَيْنِ فِي أُخْرَيَاتِ الْقَوْمِ لَمْ يُصَلِّيَا مَعَهُ قَالَ عَلَيَّ بِهِمَا فَأُتِيَ بِهِمَا تَرْعَدُ فَرَائِصُهُمَا قَالَ مَا مَنَعَكُمَا أَنْ تُصَلِّيَا مَعَنَا؟ قَالَا يَا رَسُولَ اللهِ كُنَّا قَدْ صَلَّيْنَا فِي رِحَالِنَا قَالَ فَلَا تَفْعَلَا إِذَا صَلَّيْتُمَا فِي رِحَالِكُمَا ثُمَّ أَتَيْتُمَا مَسْجِدَ جَمَاعَةٍ فَصَلِّيَا مَعَهُمْ فَإِنَّهُمَا لَكُمَا نَافِلَةٌ