In Sec 7.1.4 of RFC9180 it states that:
For X25519 and X448, public keys and Diffie-Hellman outputs MUST be validated as described in [RFC7748]. In particular, recipients MUST check whether the Diffie-Hellman shared secret is the all-zero value and abort if so.
I don't understand the need for this check (for KEM CCA2 security), but the RFC says it's a MUST.
Adding this check would make it a TryDecapsulate for X25519 which is annoying...