Zayd bin Thabit reported,

He said that the Messenger of Allah ﷺ partitioned off a small enclosure within the mosque. The Messenger of Allah ﷺ would come out at night and pray inside it. Some men prayed along with him following his prayer, and they kept coming to him every night.Then one night the Messenger of Allah ﷺ did not come out to them. They began clearing their throats, raising their voices, and tossing pebbles at his door. The Messenger of Allah ﷺ came out to them angry and said, "People, you have continued doing this until I feared that it would be made obligatory upon you. So pray in your homes, for the best prayer a person performs is in his home, except for the prescribed prayer."

Abu Dawud 1447

Sahih

حدثنا هارون بن عبد الله البزاز حدثنا مكي بن إبراهيم حدثنا عبد الله يعني ابن سعيد بن أبي هند عن أبي النضر عن بسر بن سعيد

عن زيد بن ثابت

أنه قال احتجر رسول الله ﷺ في المسجد حجرة فكان رسول الله ﷺ يخرج من الليل فيصلي فيها قال فصلوا معه لصلاته يعني رجالا وكانوا يأتونه كل ليلة حتى إذا كان ليلة من الليالي لم يخرج إليهم رسول الله ﷺ فتنحنحوا ورفعوا أصواتهم وحصبوا بابه قال فخرج إليهم رسول الله ﷺ مغضبا فقال يا أيها الناس ما زال بكم صنيعكم حتى ظننت أن ستكتب عليكم فعليكم بالصلاة في بيوتكم فإن خير صلاة المرء في بيته إلا الصلاة المكتوبة

أبو داود 1447صحيح
Contents
Reference
Commentary
Ayat
Collection
Sunan Abu Dawud
Book
Witr
Chapter
Virtue of voluntary prayer at home
Numbering
Darussalam 1447
Abu Dawud 1447