Zayd bin Thabit reported,

The Messenger of Allah ﷺ partitioned off a small enclosure using a palm-leaf mat or a reed mat, and he went out to pray inside it. Some men followed him there and came to pray along with his prayer.Then one night they came and were present, but the Messenger of Allah ﷺ was delayed in coming out to them and did not appear. So they raised their voices and threw pebbles at the door. The Messenger of Allah ﷺ came out to them angry and said to them, "Your persistence has continued until I feared it would be prescribed upon you. So pray in your homes, for the best prayer of a person is in his home, except for the obligatory prayer."

Muslim 1825

Difficult

و حدثنا محمد بن المثنى حدثنا محمد بن جعفر حدثنا عبد الله بن سعيد حدثنا سالم أبو النضر مولى عمر بن عبيد الله عن بسر بن سعيد

عن زيد بن ثابت قال

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

مسلم 1825مشكل
Contents
Reference
Commentary
Ayat
Collection
Sahih Muslim
Book
Travelers' prayer and its shortening
Chapter
Recommendation of praying voluntary prayers at home and their permissibility in the masjid
Numbering
Darussalam 1825
Muslim 1825