I’m aware of that, but Muslims hold that Allah is mutable.
A point of clarification, if I may:
Here are the relevant verses:
‘Say, ‘To whom belongs all that is in the heavens and earth?’ Say, ‘To God. He has taken it upon Himself to be merciful. He will certainly gather you on the Day of Resurrection, which is beyond all doubt. Those who deceive themselves will not believe ……. When those who believe in Our revelations come to you (Prophet), say, ‘Peace be upon you. Your Lord has taken it on Himself to be merciful: if any of you has foolishly done a bad deed, and afterwards repented and mended his ways, God is most forgiving and most merciful.’ (Al-An‘am: 12 and 54). Translation by Professor M.A.S. Abdel Haleem.
The words ‘taken it upon’ render the Arabic ‘kataba’ This word can also be rendered ‘prescribed’ and ‘ordained’.
Shaykh Seyyed Hossein Nasr (who renders ‘kataba’ as ‘prescribed’) writes:
‘That God has prescribed Mercy for Himself (see also v. 54) indicates that although God remains absolutely free, He has nonetheless obligated Himself to act with mercy toward His creatures.
‘A well-known ḥadīth qudsī (sacred ḥadīth) conveys the same message, “When God decreed the created realm, He prescribed for Himself in a Book that is with Him, ‘Truly My Mercy prevails over My Wrath,’”; and in another ḥadīth qudsī, God says, “My Mercy has precedence over My Wrath.” The Prophet reportedly would pray during his daily devotions, “O God, I seek refuge in Thy Contentment from Thine Anger, and in Thy Forgiveness from Thy Punishment, and in Thy Mercy from Thy Wrath.’
Referring to verse 54 the Shaykh writes:
‘In a ḥadīth mentioned in connection with this verse the Prophet asks, “Do you know the right of God over the servants? (It is) that they worship Him and not ascribe partners unto Him.” Then he said, “Do you know the right of the servants over God if they do this? (It is) that He not punish them”’ (‘The Study Quran: A New Translation and Commentary’).
There is no justification for claiming (as certain folk do – Sam Shamoun, for example; but no Muslim scholar that I am aware of) that these verses (and aḥādīth) teach that the Exalted is mutable. He is most certainly
not. They refer, not to His essential nature, but to His gifts (freely given) of mercy, in place of wrath; of forgiveness, in place of condemnation.
Mercy and forgiveness are referred to as ‘attributes of action’ (sift al-fi’l); which come to be when the Exalted intends something and acts. Attributes of essence - such as immutabity - are referred to as ‘ifat al-dhat’ or ‘sifat al-nafs’.