I think the saying itself means that the person, (or even persons with opposing views) have good intentions for an outcome, but are not doing the best/correct/helpful/useful thing to bring about a good outcome.
An example of opposing views: both parents want to raise healthy, responsible children, but one parent doesn’t want to allow their child to pick their own friends, or to go to any events with other kids that they deem “questionable”. Another parent might let their child hang around with whomever their child chooses, maybe without vetting those kids or their families, and lets their child participate in events without knowing who else might be there, or what else might be taking place at said event.
The first parent doesn’t trust their own child to make good decisions, and stunts their child’s sense of self-worth, and the second parent doesn’t want to stifle their child’s autonomy, but fails to teach them how to be safe.
Both of these examples of parenting techniques are likely to cause problems (different problems) for their children, but their hearts are in the right place, even if they ultimately end up doing a disservice for their kids.