She served briefly as her son's regent when James II died in 1701 and would not accede to Scottish demands that her son, James III, renounce Catholicism for the throne of Scotland--but compromised on restrictions of the number of Catholic priests in England and leaving the Church of England intact when he should succeed William of Orange. Perhaps Mary of Modena erred in not allowing the young king to go Scotland in 1702 and she ended her regency when he turned 16.
Mary of Modena remained at St. Germain-en-Laye but also spent time at the Convent of the Visitation nuns at Chaillot in Paris (destroyed, of course). She had wanted to be a nun before her marriage in 1673 and thus her attraction to the convent, where she met the former mistress of Louis XIV, Louise de la Valliere. Her daughter Louisa Maria had been born in France in 1692, but died in 1711 of smallpox--and the loss her daughter, along with the departure of her son after the Treaty of Utrecht removed French support of his claim to the throne, devastated her. She was buried in the Convent of the Visitation and thus her grave has been lost. She died of cancer on May 7, 1718, alone in France as James Francis Edward was exiled after France recognized the Hanoverian succession in the Treaty of Utrecht.
Some in France called her a saint; she had certainly endured many vicissitudes: exile, the unfaithfulness of her husband, little babies dying, widowhood, the loss of her daughter, and separation from her son--and by all reports, Queen Mary Beatrice responded to these sorrows by relying on prayer and her Catholic faith.