All perfect praise be to Allah, The Lord of the Worlds. I testify that there is none worthy of worship except Allah, and that Muhammad is His slave and Messenger.
The scholars differed in opinion regarding the ruling on congregational prayer, so the majority said that it is a Sunnah while some scholars said that it is a communal obligation. The Hanbali scholars are of the view that praying in congregation is an individual obligation on adult men, and it is the view that we adopt here in Islamweb.
Most of the scholars who are of the view that praying in congregation is an obligation, are of the view that it is valid to perform it at any place and they do not condition that it be in the mosque; this is this the view we adopt as well.
Therefore, whoever prays in congregation in his home has achieved the virtue of the congregation and he is no longer sinful, but he has missed the virtue of praying in the mosque.
It a person prayed alone while he was able to pray in congregation, then his prayer is valid but he is sinful due to abandoning the congregation, which is an obligation.
As for the Hadeeth that you mentioned, it was narrated by Ibn ‘Abbaas that the Prophet said: “Whoever hears the call to prayer and is not prevented from joining the congregation by any excuse, his prayer is invalid. He was asked: ‘What is an excuse?’ He said: ‘fear or illness.’” [Abu Dawood and Ad-Daraqutni]
There is a difference of opinion about the validity of this Hadeeth; Al-Haakim classified it as Saheeh (authentic), and many scholars of Hadeeth classified it as Dha’eef (weak), such as Ibn Al-Mulaqqin.
Allah knows best.