Accessibility service will be turned off by some phone vendors automatically after some while. This causes the keystroke logger to stop working.
The known vendors are:
You can contact your phone vendor for a feature request and hope they will change their mind.
Ask them why they turn off accessibility service automatically and how to keep it on.
We have no way to bypass their limit currently.
You may also switch to the Custom Keyboard driver to log keystrokes.