The "Refresh" button in the key details should always check on WKD if there are UIDs with mail addresses.
Edit 2025-02-05: The button in question is now labeled "Update", the same action available in the context menu now is named "Update certificates".
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.