Is Miscalculating Menstrual Purity a Sin in Islam?
Question

If a woman does not get a white discharge, and instead she waits for the bleeding to stop, the number of days (of the period) may vary from one month to the next. Is she sinning if she makes a mistake about when she becomes pure, such as if she thinks that she became pure, then after doing ghusl and praying she finds traces of it or, conversely, if she waits and misses some prayers because she thinks that she has not yet become pure, because it is difficult for her to know when she becomes pure without that white discharge? May Allah reward you with good.
Praise be to Allah.The Signs of Menstrual Purity in Islam
Menstruation differs from one woman to another, and the signs that one woman’s period has ended may vary from time to time.
For most women the sign that the period has ended is the emission of the white discharge. For some women the sign is that the bleeding stops.
No matter what the sign is for a woman, it is not permissible for her to hasten until the sign appears, because  it is not permissible for her to pray or fast when she is menstruating, until she becomes pure.
The women used to send containers to `Aishah (may Allah be pleased with her) in which were the cotton pads  with traces of yellow on them. She would say: “Do not hasten until you see the white discharge.”
(Narrated by Al-Bukhari in a Mu`allaq report in Kitab Al-Hayd, Bab Iqbal Al-Mahid wa Idbarihi (Book of Menses, Chapter on the start and end of the menstrual flow); and by Malik, 130)
What to Do If Menstrual Purity Timing Is Miscalculated
If a woman makes a mistake about the time of the end of her period, based on her own reasoning, then she is not sinning, because Allah says (interpretation of the meaning):
{And there is no sin on you concerning that in which you made a mistake, except in regard to what your hearts deliberately intend.} [Al-Ahzab 33:5]
And the Prophet (peace and blessings of Allah be upon him) said: “Allah has forgiven my Ummah for mistakes, what they forget and what they are forced to do.” (Narrated by Ibn Majah, 2053; classed as authentic by Al-Albani in Sahih Ibn Majah)
But if she thinks that she has become pure and she prays and fasts, then she realises that she is still menstruating, then she has to stop praying and fasting until she becomes pure, and she should make up the obligatory fasts that she observed during that time, because it is now apparent that they were not valid, because the fast of a menstruating women is not valid.
If she stops praying because she thinks that she has not yet become pure, then she finds out that she was pure, then she has to make up those prayers.
Shaykh Ibn `Uthaymin (may Allah have mercy on him) was asked (11/280) about a woman who saw a brownish discharge before her usual period, so she stopped praying, then the blood came at the usual time. What is the ruling on that?
He replied:
Umm `Atiyyah (may Allah be pleased with her) said: “We used to not regard the yellowish and brownish discharge  after the Tuhr (white discharge indicating that the period is over) as being of any significance.” Based on this, this brownish discharge that comes before the period does not seem to me to be part of the period, especially since it came before the usual time of menstruation and there were no other signs of menstruation such as cramps, backache, etc. So it is better for her to make up the prayers that she missed during this time.
He was also asked (11/275) about a woman who bled for nine days, so she did not pray, thinking that this was her period. Then a few days later her real period came – what should she do: should she make up the prayers of the days she missed or what?
He replied:
It is better for her to make up the prayers that she missed during the first days, but if she does not do that there is no sin on her, because the Prophet (peace and blessings of Allah be upon him) did not command the woman who was suffering from severe Istihadah (non-menstrual vaginal bleeding) and had stopped praying because of that, to do so.
The Prophet (peace and blessings of Allah be upon him) told her to regard six or seven days as her period and to pray during the rest of the month; he did not tell her to repeat the prayers she had missed, even though making up the prayers she had missed would have been good, because she may have been negligent in not asking before, but even though she did not repeat them there was no sin on her.
And Allah knows best.