Thanks for reporting this! I’m aware of the problem and I’m actively looking for solutions, but so far I haven’t found one.
It seems to be related to the new iOS17 predictive typing, because most often the duplication of text will happen when iOS tries to predict the rest of a sentence.
I’ll keep looking for a solution, since it’s quite jarring. Will keep you posted (: