ADB claims that app is not installed when uninstalling and that it is installed when installing
It seems like the package wasn't properly uninstalled : This happens usually if you delete the APK from /data/app or /system/app or /system/priv-app instead of uninstalling the app. That is why probably the adb uninstall command isn't working.

Maybe you can try reinstalling the app again after rebooting your phone?Tip: If this is the only keyboard app on your phone, it would be better if you install another keyboard app just as a backup before rebooting (especially if you have a text lock screen password).

If it still doesn't work after rebooting, try uninstalling the app only for the current user and then reinstall it from the play store.

adb shell pm uninstall --user 0 com.google.android.inputmethod.latin


Also, if possible, please also share the output of this command

adb shell dumpsys package com.google.android.inputmethod.latin


(Sorry, I am a new member and do not have commenting permissions yet; that is why I have to mention it here.)