Just as a process of elimination can you download a keyboard such as gBoard and see if that works as it should @OnlyAlex
Other options are to try Safe Mode > https://www.samsung.com/uk/support/mobile-devices/how-to-start-my-galaxy-device-in-safe-mode/ turns off downloaded apps and themes etc which may highlight an app or theme that's causing conflict.
And go into the Samsung Keyboard Settings and fully reset it.
Ensure there are no pending updates.
My Samsung Keyboard is working as it should.
Daily Driver > Samsung Galaxy s²² Ultra 256Gb in Phantom Black.
The advice I offer is my own and does not represent Samsung’s position.
I'm here to help. " This is the way. "