I think that might be dependent on the keyboard your flagship provider ships with, and some are better than others. Thankfully, you can switch out the keyboard handler. That is, Android suffers from similar problems, some sometimes Android's modularity and allowing for choices comes through to save you.
But still, the perverse incentives of Google make privacy a real question. Then again, if I was willing to put up or shut up, I would probably be running a de-googled AOSP based version of Android. :/
Your are short on memory and the keyboard is being unloaded. The fact that you never have to close apps because the OS will dynamically unload unused apps and restore them is sort of a lie.
Reboot every few days, delete bullshit phone games that just for fun ensure they start quickly by loading every time you start your phone starts along with any other worthless apps you don't actually want or need.
It's sadly no better on the Android side of the fence either. How many times I've had to wait for the keyboard app to decide to load…