mental depression

How can Ranitidine (Zantac) cause mental depression and endocrine related side effects? Its mechanism of action is to lower stomach acid by antagonising the relevant receptor. Regardless of the rate of incidence, how can it cause (i.e. mechanism of action) mental depression and endocrine problems?