There is massive confounding here. Think of the counterfactual — kids who live in a house with a failing relationship, or one where the adults can’t meet each other’s needs.
It’s not at all obvious this would be better, and none of the research suggests it’s better for kids for adults to stay in a troubled relationship. In fact the reverse - conflict in the home is a much stronger predictor of poor outcomes than divorce per se.