getUserIdentities was implemented to match the API of the underlying findUserIdentities, so that it could be a drop-in replacement. This API has no way to distinguish a successful fetch with no result versus a timed-out fetch.
UserIdentityCache exposes a method that currently doesn't have any uses: getCachedUserIdentity. We could use this method to distinguish the two cases, except that we don't currently cache timed-out results (failedQueryCacheTimeout is 0).
By switching these two, we make sure we store null for a successful fetch with no result. Then we can treat a value that is missing from cache after an attempted fetch to be a timeout case.