Suppose that Alice has an X25519 key pair $\{S_A,P_A\}$ (secret and public key, respectively). Using randomly selected X25519 public keys $\{P_*\}$ (such that $P_A\notin \{P_*\}$), Alice calculates several values $X_* = \operatorname{X25519}(S_*,P_*)$.
She then repeatedly flips a (fair) coin. Each time, if the result is heads, she sends a (truly) random 256-bit string to Bob. If the result is tails, she sends some value in $\{X_*\}$ to Bob. Bob does not know the result of the coin flip.
I know that the output of the ECDH function is not uniformly random, so how can Bob determine—with more than 50% accuracy—whether Alice has sent him a random string or a value from the set $\{X_*\}$?
Bob knows $P_A$ and the curve parameters, but he does not know the elements of the set $\{X_*\}$.
This question is distinct from Distinguishing x25519 public keys from random?, which asks about distinguishing X25519 public keys from random. This question asks about distinguishing the output of the X25519 function (i.e., the shared secret computed with the ECDH function) from random. Given two secret, public key pairs $\{S_A,P_A\}$ and $\{S_B,P_B\}$, that is, this question asks how to distinguish $\operatorname{X25519}(S_A,P_B)$ (or, equivalently, $\operatorname{X25519}(S_B,P_A)$) from random, while the other question asks how to distinguish $P_A$ and $P_B$ from random.
Edit: Fixed names of variables. $S_*$ was intended to be $X_*$.