The "Refresh" button in the key details should always check on WKD if there are UIDs with mail addresses.
Therefore the call to gpg --refresh-keys needs to be replaced by something else.
The WKD search should be done even if origin is "unknown" and not "WKD". And regardless of whether a keyserver is configured or not.