A family of Microsoft word processing software products for creating web, email, and print documents.
This is not normal Word behavior. Please test a new blank document using Microsoft Edge, preferably first in an InPrivate/Incognito tab. Microsoft recommends Edge for Word for the web.
The most important test is to temporarily change the default input method to Gboard or Microsoft SwiftKey under Settings > General management > Keyboard list and default > Default keyboard.
Could you confirm which browser you are using, whether this also happens in a new blank document, and whether “Samsung keyboard” refers to the on-screen keyboard or the physical Book Cover Keyboard?