One good example:
regreSSHion, CVE-2024-6387, is an unauthenticated remote code execution in OpenSSH’s server (sshd) that grants full root access. It affects the default configuration and does not require user interaction. It poses a significant exploit risk. https://www.qualys.com/regresshion-cve-2024-6387
With WireGuard, using a pre-shared key, attackers are interacting with virtually no code unless they have a valid encrypted packet, and then they still need the peer key to connnect.
With an SSH server, there's a lot of code being executed by any remote attacker pre-authentication. Any exploit in this code can grant access. This is just inherently more risky.