This issue is mostly related to the parallel work on the config parsing by me and rewrite of the knownhosts api by Andreas. The global knownhosts file was a new thing at this time and therefore I am not very surprised this slipped through.
Needs Triage (8)
The following changes should settle the behavior to more sane that follows openssh and does not cause problems if there are more host keys stored in the known_hosts files:
a) We what the same what OpenSSH does. I think the function ssh_known_hosts_get_algorithms() just gets the one from known_hosts but dosn't deal with the supported defaults.
b) The global hosts file is not supported in the new known_hosts API I totally forgot to impelment that. See T107
This is actually implemented by the function ssh_known_hosts_get_algorithms(), but behaves a bit differently than a similar function in OpenSSH client:
Wed, Oct 17
Does this patch work for you? https://git.libssh.org/users/asn/libssh.git/commit/?h=master-fix&id=89e14d61a07e2c722898760555f66b809305a605