Ibn Al-Qayyim said:
“Reflecting on the Sunnah deeply, one could realise that it is an obligation on a Muslim man to perform the congregational Salāh in the mosque unless there is an incidental cause that deters one from doing so. Both abandoning the mosque and the congregational Salāh – with no Islāmic reason – have the same ruling and hence the meanings in the ahādīth could be easily joined.
When the Prophet (saw) died and the bad news reached the people of Makkah, Suhayl Ibn ‘Amr delivered a speech and gave safety to Attāb Ibn Usayd, who was the Prophet’s deputy in Makkah and who concealed himself from the people of Makkah out of fear.
The people of Makkah remained on their Islām. Then Attāb delivered his speech saying, “O people of Makkah, by Allāh whoever abandons attending the mosque and doing Salāh with the congregation, I will cut off his head.”
The Prophet’s companions admired Attāb’s words which raised his rank in their eyes.”
[As-Salāh Wa Hukmu Tārīkhuhā, p.137]