We Never Know
No Slack
Except when the DNA is wrong:
Complete androgen insensitivity syndrome - Wikipedia
DNA is just a roadmap, but the body often takes detours and those detours are just then factored into the route connection. Basically, we're born with a map of possibilities but which possibilities manifest (genes are activated) depends on our environment. Biological sex can't be reduced to just one thing because there's so many factors and variables.
DNA is wrong. Got it.