First of all, it is important to be known that it is disliked for one fasting to exaggerate in rinsing the mouth and sniffing water up his nose during wudu and ghusl, because of the probability that something will reach his body cavity. And of course, the sunna is to do it three times, and to do it more than that is disliked.
Having said this, know that our scholars have set apart the ruling of water reaching the body cavity, unintentionally, while rinsing the mouth during wudu and ghusl. They said that if the water reached the body cavity by rinsing out the mouth a fourth time, or because one exaggerated [s. during the first three times], then the fast is invalid, because it originated from an action that was disliked.
However, if it reached the throat, during the first three legitimate rinses of wudu, without exaggeration, the fast is not invalidated, because it originated in an action that was called for.