All perfect praise be to Allaah, The Lord of the Worlds. I testify that there is none worthy of worship except Allaah and that Muhammad is His slave and Messenger.
The sharee'ah forbade making istithnaa’ (i.e. saying inshaa’ Allaah, meaning if Allaah wills) in supplication. It has been authentically reported on the authority of Abu Hurayrah that the Prophet said, "None of you should say: 'O Allaah! Forgive me if You will,' or 'Bestow Your Mercy on me if You will,' or 'Provide me with means of sustenance if You will,' but he should be firm in his request, for Allaah does what He wills and none can force Him (to do anything)." [Al-Bukhari]
The version of the hadeeth cited in Saheeh Muslim reads, "None of you should say to Allaah (like this): 'O Allaah, grant me pardon, if You wish,' but he should ask (his Lord) with absolute resolve and desire great things, for there is nothing so great in the eye of Allaah that He cannot grant it." [Muslim]
Muslim scholars held different views regarding the religious ruling on such an act and whether it is disliked or forbidden. An-Nawawi wrote, "Chapter on the prohibition of istithnaa' in supplication, i.e. saying 'O Allaah, forgive me if You wish; Have mercy upon me if You wish.'" [Riyaadh As-Saaliheen]
Al-ʻIraaqi wrote:
"The preponderant scholarly view is that the prohibition in this regard means that such an act is disliked (makrooh), as advised by An-Nawawi in Sharh Muslim. Ibn ʻAbd Al-Barr remarked in his book At-Tamheed that it is impermissible to say 'O Allaah, grant me such-and-such if You wish; have mercy upon me if You wish; pardon me if You wish, and grant me all that is good pertaining to the worldly life or the Hereafter if You wish,' because the Prophet forbade doing so. Moreover, the indication of such statements is inconceivable (and improper) because Allaah, The Exalted, does only what He wishes ( none can force Him into doing anything) and He has no partners. The apparent indication is that such an act is forbidden. Also, it may be interpreted as just meaning negating permissibility without meaning prohibition (i.e. it is non-prohibitively disliked), yet it is unlikely." [Tarh At-Tathreeb fi Sharh At-Taqreeb: 3117]
The well-versed scholar Ibn ʻUthaymeen said that the preponderant view is that such an act is forbidden, as asserted in his book Sharh Riyaadh As-Saaliheen.
Allaah knows best.