The reasons for being more careful could be all over the place, ranging from actually being better programmers to being more likely to receive criticism for a bad pull request.
In an industry that's somewhat hostile to women, it wouldn't be surprising that only the most competent women stick around, whereas less competent men stick around more than less competent women, dragging average competency of men in the industry down, even if the total number of competent men might be higher than the total number of competent women.