Praise be to Allah, and may peace and blessings be upon the Messenger of Allah. To proceed:
The ruling differs according to the reason for making such a statement. If the non-acceptance of the prayer is known according to Islamic law because the prayer is invalid due to omitting a condition or pillar, or performing an act that invalidates it, then it is permissible to state that it is invalid and not accepted. But if the prayer fulfills its conditions and pillars, then it is not permissible to definitively state that it is accepted or not accepted, because acceptance is connected to hidden matters, such as sincerity, the reality of which is known only to Allah تعالى.
If it is known that the prayer was performed in a manner that Islamic law judges to be invalid, it is permissible to judge that it is invalid and not accepted.
Examples include:
If a legally recognized reason establishing the invalidity of the prayer is confirmed, it is permissible to judge that the prayer is invalid, because this judgment is based on a known ruling of Islamic law.
If the prayer is outwardly valid, its performer has fulfilled its conditions and pillars, and nothing invalidating it has appeared, then no one may definitively state that it is accepted or not accepted, because acceptance is among the matters of the unseen whose reality is known only to Allah تعالى.
A person may see the outward form of an act, but he does not know what is truly in the heart of the person who performed it, such as sincerity, showing off, or other matters that affect the acceptance of deeds.
For this reason, the Permanent Committee for Fatwa said:
“Knowledge of whether acceptance has occurred or not is among the matters of the unseen, which no one knows except Allah.”
Therefore, if someone says: “So-and-so’s prayer is not accepted” merely because he saw that person committing some wrongdoing or speaking improperly, and then definitively declares that his prayer was not accepted, he has made a statement without evidence.
A distinction should be made between speaking falsely about Allah and swearing or presuming upon Allah.
If a person definitively declares that someone’s prayer is not accepted without a legal evidence establishing this, then he has spoken about Allah تعالى without knowledge, because he has passed judgment on an unseen matter known only to Allah.
As for describing this specifically as presuming upon Allah, that is not precise in this particular case, because the term originally refers to swearing an oath.
The Prophet صلى الله عليه وسلم said in the sacred hadith:
“A man said: By Allah, Allah will not forgive so-and-so. Allah تعالى said: Who is he who presumes upon Me that I will not forgive so-and-so? Indeed, I have forgiven so-and-so and nullified your deeds.”
Narrated by Muslim (2621).
Imam al-Nawawi, may Allah have mercy on him, said:
“‘Yata’alla’ means: he swears an oath; and al-aliyah means an oath.”
Thus, the man in the hadith swore that Allah would not forgive that person, and for this reason his action was described as presuming upon Allah.
If a prayer is invalid according to Islamic law because of omitting a condition or pillar or committing a known invalidator, it is permissible to judge that it is invalid and not accepted.
But if the prayer is outwardly valid, it is not permissible to definitively declare it not accepted merely because of the poor conduct of the person who performed it or because he commits some sins, since acceptance of deeds is among the matters of the unseen known only to Allah.
Definitively declaring that it is not accepted without evidence is speaking about Allah without knowledge, but it is not called presuming upon Allah unless it involves an oath or swearing, because presuming upon Allah in this context means swearing an oath.
And Allah knows best.