Distinct people sharing a birthday

Let’s say I have the following database:


The question I want to answer is “Are there two distinct people who share a birthday, and if so, who are they?” To answer this, I queried the following, but it just cycles through all the options and I’m not sure why this is:

?- birthday(X, date(Y, M, D)), birthday(Z, date(Y, M, D)).

Why doesn’t this only return true if X and Z have the same birthday?

That works, but I don’t understand why because I didn’t cover symmetry breaking.

As an alternative you could also do:
birthday(X, date(Y, M, D)), birthday(Z, date(Y, M, D)), X \= Z.
i.e. "two people X and Z, such that they have the same birthday and not the same name (indicated by X\=Z).