King Brimer of the Storm Giants sought to conquer Asgard, but the presence of Heimdall discouraged him from storming the kingdom's gates. Brimer sought the help of the sorceress Nedra and devised a plan to summon an air creature of the Vanna race, a people nimble enough to sneak past Heimdall's detection and spy on Asgard. The spy made it past Heimdall, but not completely out of his range of perception. In sensing a disturbance, Heimdall swung his sword in defense at seemingly empty air. Heimdall felt uncertain in his abilities of detection, but still feared for Asgard's safety.
As the agile Vanna creature made its way through meetings and conversations of Asgardians, Heimdall sent word to Odin of the possibility of an invader who made it past his post. When the Vanna creature made it to Odin's meeting place, Odin heeded Heimdall's warning and used his Odinpower to detect the invader. The Lord of Asgard captured the spy and Heimdall confessed his failure and surrendered to Odin. Instead of punishment, Odin rewarded Heimdall for his loyalty to Asgard--even at the expense of exposing his own failure--and returned the warrior to his post.
Heimdall suffered another defeat at the hands of the fire demon, Surtur. Surtur stormed the Rainbow Bridge to gain access into Asgard to recover the Eternal Flame stolen from him by Odin and essential to his plan to bring about the world-ending Ragnarok. As guardian of the gate, Heimdall valiantly held his post, but was swiftly defeated by the demon who rivaled Odin in power. Having disposed of Heimdall, Surtur smashed the Rainbow Bridge to pieces.
The tale of Heimdall's humility can be found in JOURNEY INTO MYSTERY #105, again collected in THOR: TALES OF ASGARD, while his defeat by Surtur came in THOR #351, found collected in THOR VISIONARIES: WALTER SIMONSON VOL. 2