I can reproduce this in Gboard, though not with Samsung Keyboard or SwiftKey. I can also reproduce it in Froala, CKEditor and TinyMCE, which makes me think this is very much a Gboard bug. Unfortunately, that means that there's very likely nothing we can do about it. You should still be able to move the cursor manually at least (obviously not ideal).
I will leave this open for now to see if anything comes up.