There’s a very annoying defect in MS Teams that when you try to edit your message in the message input box, the text cursor unexpectedly jumps to the end.
There is an easy workaround to this issue: Click at your avatar > Setting > General and disable the spell check option.