They are two different things. The genes are a set of instructions, but nowhere is it guaranteed that those instructions are going to be correctly followed. Nature is an imperfect process, and rather complex, with plenty of opportunity for mistakes in following the genetic code.

With humans, there's about nine months of pregnancy. Nine months where the body and brain are being developed. Nine months where hormones that go out of whack, where drugs, both prescription and recreational can affect development, where physical harm can occur. None of these can be predicted in the genes.

So, just because something has a biological cause, it doesn't mean you can check the genes and find it.