This happens to me constantly all day long. I'm about to sell this phone as 70% of the time I can't use this phone for basic tasks.
I did experience a hiccup with the Samsung Keyboard when I updated to Android 12.
Initially I turned Off Predictive text which helped.
However I ended up resetting the keyboard back to default.
I also used SwiftKey and gboard keyboards too.
Generally if a phone is misbehaving after an update then these generic troubleshooting guides may help.
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. "