Asking personal questions could be seen as a way to elicit information about a protected status and thus give a rejected candidate ammunition for a claim, whether warranted or not.
It’s best to just keep questions focused on the workplace.
Even in the case of complete innocence, it often becomes a he-said-she-said situation, and the outcome boils down to which side presents the best set of “facts”.
I use quotes there because my broader experience with the court system routinely shows that it does not need be burdened by the “truth” or “facts”. That is probably because the regular cast in those venues are literally trained and practiced liars.
But if you're at a large enough company, you're absolutely getting sued for this from time to time, so you'll have the "how to not get sued" training before you're allowed to interview.
(Edit: this isn't limited to interviews. There's many, many examples of things that large companies will not touch due to legal risk, that smaller companies will... either due to lack of knowledge on the legal risk (maybe no legal department even exists yet?) or intentionally as a gamble)
It is illegal, and in my book also immoral to deny such a candidate, but the other side of the coin is there.