Praise be to Allah.
So long as you did not know that swallowing this food breaks the fast , then you do not have to make up those days, because ignorance of things that break the fast is a valid excuse, according to the correct view.
Shaykh Ibn `Uthaymin (may Allah have mercy on him) said:
“Things that break the fast and that may be done voluntarily, do not break a person’s fast unless three conditions are met:
- The first condition is that he is aware, and the opposite of awareness is ignorance.
So if a person eats something and he is ignorant, then he does not have to make up that day. Ignorance is of two types:
- Ignorance of the ruling, such as if a person vomits deliberately but he is not aware that vomiting breaks the fast . In this case, he does not have to make up the fast because he is ignorant.
The evidence that the one who is ignorant of the ruling does not break his fast is the report that is proven in Al-Bukhari and Muslim from the Hadith of `Adi ibn Hatim (may Allah be pleased with him), who said that he put two ropes – one black and one white – beneath his pillow. These were ropes of the type used to hobble camels. He started looking at them, and when he could distinguish between the white rope and the black one, he stopped eating and drinking. The next day he went to the Prophet (peace and blessings of Allah be upon him) and told him about that. The Prophet (peace and blessings of Allah be upon him) said to him: “Your pillow must be very wide, if the white thread and the black thread are beneath your pillow. Rather that is the blackness of the night and the whiteness of the day” But the Prophet (peace and blessings of Allah be upon him) did not tell him to make that day up, because he had been unaware of the meaning of the verse.
- Ignorance of the time. For example, if a person thinks that dawn has not yet broken , then he finds out that it had broken. He does not have to make up that day. Similarly, if a person breaks the fast at the end of the day thinking that the sun has set, then he finds out that it had not set, he does not have to make up that day either.
The evidence for that is the report narrated by Al-Bukhari from Asma’ bint Abu Bakr (may Allah be pleased with her) who said: We broke our fast on a cloudy day at the time of the Prophet (peace and blessings of Allah be upon him), then the sun came out. The point here is that if the fast was invalidated, it would have been obligatory to make it up, and if it had been obligatory to make it up, the Prophet (peace and blessings of Allah be upon him) would have commanded them to do that.
If he had ordered them to make it up, this would have reached us because it is part of preserving Shari`ah. As there is no report that says that the Messenger (peace and blessings of Allah be upon him) told them to do that, and as he did not tell them to do that, it is known that the fast was not invalidated, so it does not have to be made up in this case. But as soon as a person realizes what the situation is, he must stop eating and drinking, so that even if there is a morsel in his mouth, he has to spit it out.” (Majmu` Fatawa Ash-Shaykh Ibn `Uthaymin, 19/116)
Then he mentioned the second and third conditions, which are that he should be aware of the situation and observing the fast willingly.
Thus, it is known that you do not have to make up for these fasts.
And Allah knows best.