All perfect praise be to Allah, The Lord of the Worlds. I testify that none is worthy of worship except Allah and that Muhammad, sallallaahu ‘alayhi wa sallam, is His slave and messenger.
Interrupting an obligatory act of worship after starting it without having a valid excuse is something prohibited according to the consensus of the Muslim jurists. That is because interrupting it without having a valid excuse is a form of frivolity that contradicts the inviolability of worship. Also, there is a prohibition reported regarding invalidating the acts of worship, Allah, The Almighty, says (what means): {…and do not invalidate your deeds.} [Quran 47: 33]
Nonetheless, there is nothing wrong with interrupting an act of worship for a valid excuse, such as breaking one's fast for the sake of saving a drowning person or having fear for oneself or one's baby (as is the case of pregnant and breastfeeding women). Breaking a fast like the one asked about by the questioner entails repentance, feeling regret and a great deal of seeking the forgiveness of Allah, The Almighty, because it is an interruption of an obligatory worship without a valid excuse. However, it is not obligatory to make up for such a day in which he broke his compensatory fast, according to the majority of Muslim scholars. Rather, he is only obligated to make up for the days that he did not fast in Ramadan.
Allah Knows best.