Sayyiduna Zayd bin Thabit (may Allah be pleased with him) narrates: The Messenger of Allah (peace and blessings be upon him) made a small chamber in the mosque and began to pray in it. A man saw him (peace and blessings be upon him), and then people also began to pray along with his (peace and blessings be upon him) prayer, until one night they came but he (peace and blessings be upon him) did not come out to them. So they began clearing their throats and throwing pebbles at the door, and they raised their voices. The Messenger of Allah (peace and blessings be upon him) came out to them angry and said: "O people, this conduct of yours went so far that I thought this prayer would be made obligatory. So pray in your homes, for the best prayer of a man is the one in his home, except for the obligatory prayer."
Hadith Referenceالمعجم الكبير للطبراني / باب الزاي / 4876