In line with the Qur'anQur'an 2:286 ↗لَا يُكَلِّفُ ٱللَّهُ نَفۡسًا إِلَّا وُسۡعَهَاۚ لَهَا مَا كَسَبَتۡ وَعَلَيۡهَا مَا ٱكۡتَسَبَتۡۗ رَبَّنَا لَا تُؤَاخِذۡنَآ إِن نَّسِينَآ أَوۡ أَخۡطَأۡنَاۚ رَبَّنَا وَلَا تَحۡمِلۡ عَلَيۡنَآ إِصۡرٗا كَمَا حَمَلۡتَهُۥ عَلَى ٱلَّذِينَ مِن قَبۡلِنَاۚ رَبَّنَا وَلَا تُحَمِّلۡنَا مَا لَا طَاقَةَ لَنَا بِهِۦۖ وَٱعۡفُ عَنَّا وَٱغۡفِرۡ لَنَا وَٱرۡحَمۡنَآۚ أَنتَ مَوۡلَىٰنَا فَٱنصُرۡنَا عَلَى ٱلۡقَوۡمِ ٱلۡكَٰفِرِينَ
God does not burden any soul beyond its capacity. To its credit is what it earns, and against it is what it commits. “Our Lord, do not condemn us if we forget or make a mistake. Our Lord, do not burden us as You have burdened those before us. Our Lord, do not burden us with more than we have strength to bear; and pardon us, and forgive us, and have mercy on us. You are our Lord and Master, so help us against the disbelieving people.”
The verse teaches the prayer not to be held to account for what one forgets, matching the fasting person not being blamed for forgetful eating.
In line with the Qur'anQur'an 33:5 ↗ٱدۡعُوهُمۡ لِأٓبَآئِهِمۡ هُوَ أَقۡسَطُ عِندَ ٱللَّهِۚ فَإِن لَّمۡ تَعۡلَمُوٓاْ ءَابَآءَهُمۡ فَإِخۡوَٰنُكُمۡ فِي ٱلدِّينِ وَمَوَٰلِيكُمۡۚ وَلَيۡسَ عَلَيۡكُمۡ جُنَاحٞ فِيمَآ أَخۡطَأۡتُم بِهِۦ وَلَٰكِن مَّا تَعَمَّدَتۡ قُلُوبُكُمۡۚ وَكَانَ ٱللَّهُ غَفُورٗا رَّحِيمًا
Call them after their fathers; that is more equitable with God. But if you do not know their fathers, then your brethren in faith and your friends. There is no blame on you if you err therein, barring what your hearts premeditates. God is Forgiving and Merciful.
The verse says there is no blame for unintended mistakes, only for what hearts intend, as the forgetful eater keeps his fast.