Found this searching Google. I have the same issue with my S10e! Very annoying. Stock messages app and I can use any keyboard (mainly use Gboard but does it stock or with Swiftkey as well).
I'm not sure if that will fix it bcuz I don't have to type after the first word and it'll jump back without doing anything. This has been going on since my note 8 edge. Its more than just a settings issue....
Wife had the same issue with her s10+, when typing message using Google keyboard.
There was a setting somewhere in the gboard keyboard menu which I disabled that fixed her issue. It related to swiping the spacebar inadvertantly causing the cursor to jump back to the beginning of the sentence. I disabled the swipe spacebar related functionality. Issue resolved.
You have to change this setting as well as General-> Language and Input->on screen keyboard->Samsung Keyboard->swipe, touch, and feedback->touch and hold space bar to "No Action"