This chain is sound: all of its narrators are trustworthy and are found among those cited by Muslim, except for Ibn Qāniʿ and al-Maʿmarī, and both of them are reliable as well.
Al-Suyūṭī, in al-Jāmiʿ, also attributed the ḥadith to Aḥmad, yet when I consulted the Musnad under the section of Ibn ʿAbbās I did not find it. Allah knows best.
Al-Bayhaqī likewise recorded it in his Sunan through the last of the routes just mentioned.
Among the corroborative reports is the narration of Ibn Luhayʿah from Muḥammad ibn ʿAjlān, who heard ʿAmr ibn Shuʿayb relate—from his father, from his grandfather—that the Messenger of Allah ﷺ forbade the carrying out of the legal penalties in mosques. Ibn Mājah transmitted it.
This isnād is acceptable for supporting evidence, for Ibn Luhayʿah is deemed trustworthy; the only concern is his occasional lapses in memory.
Another supporting chain comes from Jubayr ibn Muṭʿim with the wording, “Legal penalties are not to be executed in mosques.” Al-Haythamī states in al-Majmaʿ: “Al-Ṭabarānī related it in al-Kabīr, and its chain contains al-Wāqidī, who is weak.” He adds elsewhere: “Al-Bazzār also transmitted it, and its chain contains al-Wāqidī; he is weak on account of his tadlīs, even though he explicitly stated that he had heard it.”
There is likewise a report in this chapter from Wāthilah ibn al-Asqaʿ with the wording: