fix(gateway): report failure when refreshing an unauthorized auth_code gateway (#6128)