I wish I was able to investigate this is more detail, but I just cannot reproduce it - even though my Samsung test device is on Android 13 with OneUI 5.1. Something else has to play a role in this, but I already spent countless hours on this without being able to find the cause. This just really feels like something that Samsung needs to fix. No other keyboard app is causing this problem.