This occurs on my Android device, when I have typed out a word, but then replace it with one of the suggested words. It’s fairly common that many of the letters I’ve replaced will end up appended to the end of the line.
Example: I type: suck, but I meant ‘sick’ so I tap replace. ‘uck’ is now at the end of my line. Sometimes the cursor ends up after it, and sometimes not.