To have good intentions
Describes someone whose motives are positive even if the outcome isn't. El camino al infierno está empedrado de buenas intenciones is the related proverb.
She had good intentions, even though it didn't go well.
—Why did he do it like that? —He had good intentions.
Good intentions aren't always enough.