All perfect praise be to Allah, The Lord of the worlds. I testify that there is none worthy of worship except Allah and that Muhammad, sallallaahu ʻalayhi wa sallam, is His slave and Messenger.
The talking that invalidates the Prayer is to utter two letters or more deliberately, but if this happens by mistake, such as the example mentioned in the question, then the Prayer is not invalidated according to the most correct opinion.
As for clearing one’s throat, there is a difference of opinion on whether it invalidates the Prayer or not, and the correct view, Allah willing, is that it does not invalidate it, but it is better to avoid it unless there is a need.
Allah Knows best.