“I shall pray however I wish”—he is subject to discretionary punishment for this, since a man must pray as prescribed for him, not however he wishes. And Allah knows best.
He—may Allah have mercy on him—was asked:
“If a man enters the mosque at a prohibited time, may he offer the prayer of greeting the mosque?”
He answered:
Praise be to Allah.
The scholars hold two views on this issue, both of which are reported from Ahmad. The first, which is the view of Abū Hanīfah and Mālik, is that he should not offer it. The second, which is the view of al-Shāfi‘ī, is that he should offer it. This latter view is stronger, for the Prophet, peace and blessings be upon him, said:
“When one of you enters the mosque, he should not sit down until he has prayed two rak‘ahs.”
This command applies to all times, and no case is known to have been excepted from it. As for his prohibition of prayer after dawn breaks and after sunset, several cases have been excepted from it. These include making up missed prayers, the two rak‘ahs following circumambulation of the Kaaba, repeating a prayer with the local imam, and other cases. A general text from which no exceptions have been made takes precedence over a general text from which exceptions have been made.