Yarn 2 & 3 don't usually store the full registry URL within lockfiles. This allows to easily swap the registry from one to the other without having to update all the URLs inside.
However, this can only be done if the URLs follow a specific pattern:
Artifactory doesn't follow this pattern:
Because of the extra npm-remote, the URL is non-standard and Yarn must encode it as-is within the lockfile, thus preventing it from being easy-switch.
Artifactory should use a standard URL path (on top of the existing route, for compatibility purposes).