Best practice for setting custom config variables is to make sure it starts with the name of your tool, and to never reuse generic config namespaces unless it's an agreed upon format among many different tools.
Notably, the user.identity key that's used to track the identity currently applied to a repo conflicts with other tools. The git-agecrypt tool for example expects it to be an "identity" that it can use to decrypt files as part of the smudge filter.
The recommended best-practice here would be to use git-identity.<identity> as the keys in the global config (instead of identity.<identity>), and to use git-identity.current rather than user.identity in the local repo.