In the Name of Allah, Most Gracious, Most Merciful.
All praise and thanks are due to Allah, and peace and blessings be upon His Messenger.
In this fatwa:
3- If you are not sure whether you had formed the intention from the night before to make up for a missed fast, then the basic principle is that there was no intention to that effect from the night before.
Answering your question, the Fatwa Center at Islam Q and A, states:
If the accountable person is uncertain about his intention for making up a fast, and whether he formed the intention before the break of dawn or not, then the basic principle is that he did not form an intention, because this is what is certain.
He is not sure whether the intention was there before dawn, so what is certain is that there was no intention, and what is certain cannot be changed by what is doubtful.
But if the questioner is affected by whispers from Satan, then she should continue her fast on the basis that the intention is to make up for a fast, because doubts do not count if they are many; it is essential to put a stop to whispers and doubts and not allow oneself to become carried away with them, and to avoid making things difficult for oneself, which is contrary to the easy-going teachings of Islam.
The same applies if the doubt is something that crossed your mind suddenly, when you think it most likely that the intention was sound, or there is corroborative evidence to indicate that you were fasting to make up for a missed day, such as if you do not usually fast on such a day or in such a situation except when you are making up a missed fast.
Hence the scholars said:
“Doubt after doing an action does not count for anything, and the same applies if doubts occur frequently.”
If he does break the fast – with or without a valid reason – he must make up this day, and make up another day instead.
He does not have to offer any expiation for breaking the fast, whether it was with a valid reason or otherwise, because expiation is only required for breaking the fast by having intercourse during the day in Ramadan.
If the Muslim changes his intention from making up a missed fast to observing a general supererogatory fast, he does not have to offer expiation for that, but he must seek Allah’s forgiveness and repent.
Almighty Allah knows best.