Is it permissible to perform Sunan prayers or other prayers with a cause (like Tahiyyat al-Masjid or Kusuf) during the times explicitly forbidden for prayer?
Chapter on the Times When Prayer is Prohibited
Al-Mughni
Book of Prayer
Primary text
The prevailing opinion within the Madhhab dictates that performing Sunan prayers or prayers that have a cause, such as the greeting of the mosque (Tahiyyat al-Masjid), prayer for an eclipse (Kusuf), or prostration of recitation (Sujud al-Tilawah), during proscribed times is not permissible. This view is supported by the general prohibition of prayer. The opposing view permits it, citing the Prophet's command, "If one of you enters the mosque, he should not sit until he prays two rak'ahs" (agreed upon) and the command regarding eclipse prayer, "When you see them, then pray." This specific command is taken to supersede the general prohibition. However, the primary position maintains that the command regarding these specific prayers implies recommendation (Mandub), whereas the prohibition implies prohibition (Tahrim). Abandoning the forbidden act is prioritized over performing the recommended act. Furthermore, the command is general regarding the time of the action, but the prohibition is specific regarding that time, thus the prohibition takes precedence. Analogy to making up missed prayers after Asr or Witr after Fajr dawn is invalid due to differences in the ruling's severity or the existence of time specifics.
Supporting text
A secondary opinion allows these prayers. This view is held by Al-Shafi'i and is based on specific Hadith commanding the performance of Tahiyyat al-Masjid and the eclipse prayer, which is argued to override the general prohibition.