I came to Ibn Umar at al-Balat while the people were praying, and I said, "Will you not pray with them?"He replied, "I have already prayed. I heard the Messenger of Allah ﷺ say, 'Do not pray the same prayer twice in one day.'"
حدثنا أبو كامل حدثنا يزيد بن زريع حدثنا حسين عن عمرو بن شعيب
أتيت ابن عمر على البلاط وهم يصلون فقلت ألا تصلي معهم قال قد صليت إني سمعت رسول الله ﷺ يقول لا تصلوا صلاة في يوم مرتين
[Its isnad is sahih] Nasai reported it in the book on leadership in prayer, chapter "The prayer is waived for one who has already prayed with the congregation in the masjid," no. 861, through the hadith of Husayn Muallim with this wording. Ibn Khuzayma graded it sahih in "al-Imamah," no. 1641, and so did Ibn Hibban, no. 432. Ibn Khuzayma titled his chapter on it, "The prohibition of repeating a prayer with the intention of fulfilling the obligatory prayer," and the hadith in Muwatta, 1/133, supports it.