This seems to be an issue with some apps not handling the AOSP keyboard properly. Alternatives like gBoard seem to work fine.
One workaround I've found is to hide the keyboard (lower-left-hand arrow) and try again. That'll reset the "counter." Longer-term, the better option is probably to install a more modern keyboard, but I use a Pixel Tablet 99% as just a web browsing and media device and have kept it very bare-bones. For the few times when I want to use Terminal or Collabora Office for something small and quick, I just work around it with the hide/retry maneuver. On my daily phone, its gBoard all the way (with Network denied).