The clearest statement of this idea appears in Gra on Mishlei 29, which explains that one who trusts his own heart—assuming that whatever it inclines toward must be good and refusing to deviate from it—is a fool, while one who proceeds with wisdom and seeks guidance escapes both worldly troubles and the snares of the evil inclination.
Gra on Mishlei 28 draws the same contrast, setting the person who relies on his own heart's inclinations against the one who walks with wisdom and reverence.
This theme connects to the Gra's broader concern that reliance on one's own intellect apart from Torah leads to failure, as he writes on Beur HaGra on Mishlei 11 that the upright walk with their understanding without straying from the Torah, whereas one who relies only on his own intellect stumbles in breaking his character traits.
Similarly, Beur HaGra on Mishlei 30 warns that a person whose intellect grows and who abandons the ways of the Torah by leaning on his own understanding will end up failing to grasp the wisdom of the Torah, pursuing external wisdoms instead, and denying Hashem.
The Gra qualifies where such self-reliance is appropriate, teaching on Beur HaGra on Mishlei 16 that in matters of Torah one must exert effort, while in worldly matters one must place trust rather than rely on one's own scheming.
A related idea appears in Even Sheleimah 8:8, which teaches that one whose fear of sin precedes his wisdom retains that wisdom, because fear of sin makes a person search diligently for the right path and cherish what he finds, whereas one lacking that fear does not internalize what he learns even after repeated study.