From what I understand, Custer's heroism at Gettusburg was a fluke.
He'd been given assignment of a small infantry unit, and at a key point in the fight he saw a much larger Confederate formation moving along to try and flank the Union lines.
Custer gave the order to charge despite the situation being a very obvious suicide run.
While he caught the Confederates off-guard, the sheer numbers meant that Custer's unit got shredded. Thing is, rather than admit defeat, Custer fell back, regrouped his men, and went after the Confederates a second time.
This hit-and-fade actually continued for some time past this point, leading the Confederate commander to have a frightening realization: either he was dealing with a commander so stupid or suicidal that he'd spend his last man hammering the formation, or the commander had orders to try and pin his men in place for the arrival of a much larger Union force. Either way, if he stayed in this sector his men were going to keep getting chewed up at the hands of this nutcase.
Given this, the Confederate commander gave the order for his men to fall back so that he could figure out just what the heck was going on.