This is the prayer?
"St. Peregrine, whom Holy Mother Church has declared Patron of those suffering from Cancer, I confidently turn to you for help in my present sickness. I beg your kind intercession. Ask God to relieve me of this sickness, if it be his Holy Will. Plead with the Blessed Virgin Mary, the Mother of Sorrows, whom you loved so tenderly and in union with whom you have suffered the pains of Cancer, that she may help me with her powerful prayers and loving consolation.
But if it should be God’s Holy Will that I bear this sickness, obtain for me courage and strength to accept these trials from the loving hand of God with patience and resignation, because he knows what is best for the salvation of my soul. St. Peregrine, be my friend and patron. Help me to imitate you in accepting suffering, and to unite myself with Jesus Crucified and the Mother of Sorrows, as you did. I offer my pains to God with all the love of my heart, for his glory and the salvation of souls, especially my own. Amen."
A vow cannot impose a grave obligation in a matter which is inherently light. While it can often be difficult to establish a hard and fast rule on this matter, it seems to me that the recitation of this prayer could hardly be binding under pain of grave sin.
In any case, even if there were a grave obligation, a mortal sin cannot be committed through simple forgetfulness.
Source: