Praise be to Allah.
If the amalgam of the filling is mixed with oil of cloves to soothe the nerve, then this does not invalidate the fast, even if you notice the taste of cloves, because nothing leaches out of the filling, or it is a very small amount that mixes with the saliva and cannot be expelled, so it is overlooked, as any water that is left over after rinsing one’s mouth when doing wudu’ and mixes with the saliva and reaches the stomach is also overlooked, and as any remaining taste of the siwak in the mouth is also overlooked.
Doctors have stated that the siwak contains eight chemical substances that protect the teeth and gums from disease, and they dissolve in the saliva and enter the pharynx. It is narrated in Sahih al-Bukhari from ‘Amir ibn Rabi‘ah: I saw the Messenger of Allah (blessings and peace of Allah be upon him) cleaning his teeth with the siwak whilst he was fasting more times than I can count.
Any such substance that enters the stomach is overlooked, because it is a small amount and is not ingested deliberately.
End quote from Muftirat as-Siyam al-Mu‘asirah, p. 33, by Dr. Ahmad al-Khalil; al-Muftirat at-Tibbiyyah al-Mu‘asirah, p. 165, by Dr. ‘Abd ar-Razzaq al-Kindi.
If this substance is overlooked because it is a small amount and is not ingested deliberately, then the traces of cloves are also overlooked, if we assume that anything leaches from the filling.
See also the answers to questions no. 49658 , 92923 , 78438 .
And Allah knows best.