Author's Note: A short entry in the "fanon!goblins are so amazingly competent, it's a wonder they didn't solve the problems of the books before the books had a chance to occur" genre. Except, here, they do.
Gringotts's most carefully-guarded secret was that the contents of the vaults were not, in fact, sacrosanct.
Over centuries of operation, the goblins had learned the hard way that wizards could not be trusted to load their vaults with tools to assist potential break-ins. After all, there was no such thing as an plutocrat too rich to not enjoy the thought of himself a bit richer and his peers a bit poorer. The recent Wizarding War did not help goblin paranoia at all; the goblins had fended off multiple break-ins aimed at the vaults of families who refused to kneel to "Lord" Voldemort, with significant loss of life, and did not for a second imagine that Voldemort's apparent demise would cause the attacks to cease. If nothing else, several of the Purebloods who had pleaded the Imperius had made significant withdrawals from their vaults immediately before their pardons, and their lifestyles would demand replenishment of their wealth by fair means or foul in short order. Only an idiot would think all of them would piously adhere to legitimate means.
So the secret sweeps of the vaults continued, and hit paydirt in Vault 179 - the Lestrange vault. The risk of sweeping the Lestrange vault had been very high when the Lestranges were active - Bellatrix, in particular, had been obsessive about visiting the vault regularly and without prior appointment, and had spared no expense in picking out the very best security. Her behavior, in short, had been the exact opposite of someone who wanted to compromise Gringotts's security. However, the Lestranges dropped out of sight for several months after the Dark Lord's disappearance - most uncharacteristic, to the point that the goblins had to recheck their monitoring tapestries several times to verify the Lestranges were still alive - and resurfaced only to be arrested after a senseless assault on the Longbottoms. Since derangement could radically change a personality, prior evaluations were no longer to be trusted - and, indeed, a search of the Lestrange vault immediately turned up a disturbing artifact.
Upon first glance, it appeared to be an innocuous goblet; the most peculiar thing about it, from a goblin perspective, was that it was well-crafted and tastefully-made without any of the subtle signs of goblin manufacture. While wizards could be competent craftsmen, they largely hadn't bothered since the goblins fell under their dominion... a long, long time ago. Further superficial inspection turned up a match to old photographs of the famous Cup of Helga Hufflepuff, for which the House of Smith had offered a sizeable reward for decades... one upon which the goblins couldn't collect without raising unwelcome questions as to where and how they had discovered it after all this time. Bother. It stung to have to resort to the old 'anonymous do-gooder too pure for monetary reward' song-and-dance, but better that than attracting the attention of the always-hungry Wizarding regulators.
Of course, discovering one family's heirloom in another family's vault was far from unusual, with wizards' cavalier attitudes towards property rights, and that wasn't what had attracted the attention. This nasty little object had a sentient intelligence attached. A true sentient intelligence, not the impressive imitations that portraits and other geegaws could manage. That meant only one thing: a living soul.
A living soul attached to an inanimate object, in theory, wasn't particularly malicious. In practice, any soul that had mastered the trick of leaving its original body could pull the same trick with any other bodies, animate or inanimate, and depart for a new vessel. Such as, say, any of the guards standing watch outside the vault. Or the dragon guarding the vault, which remained imprisoned for the sole reason that it was too stupid to work out how to melt its chains. Or any other bodies it might acquire over the course of repeated jumps, up to and including the top administrators of Gringotts, who could authorize almost any action almost without justification. Or, if merely tampering with the financial structure of the Wizarding world proved too unambitious for it, it might decide to go after the actual rulers of goblin society...
The sweepers who reported it were quarantined (for their own safety as much as that of others) and the inspection team handled it with extreme care. Fortunately, it was only a fragment of a soul, and correspondingly weaker. Unfortunately, that implied the rest of the soul was walking about in the world, and might well have planned to compromise the bank by coordinating actions with his chunk of soul. (Possibly "her chunk of soul": the one obsessively fussing over the vault had been Bellatrix, not Rabastan or Rodolphus.) Security was quietly increased across Gringotts for the duration of the situation with the soul piece, lest its owner attack the bank in a blind panic over what was being done to a fragment of his immortal soul.
With security ensured, the inspection team set about a complicated ritual in one part based off of notes recovered from the infamous Ekrizdis raid and in another part adapted from rituals dating back to the early Roman Empire, if not before. At the end of several hours, the ritual room was stained with unpleasant splotches of black and dark red, the floor was engraved with complex incantations and carefully-calculated geometrical patterns, and the center of all this muck was occupied by a sickly, scrofulous pig.
It had been in perfect health before the ritual, of course.
Of course, casting spirits into swine was the ancient portion of the ritual, attested even in Muggle literature. The latter-day contribution was the art of sucking souls out of unwilling vessels. And that took effect as six silvery, screaming spirits came flying into the room, the swine giving a little jolt as each one sank into its flesh. The sixth took by far the longest to arrive, providing the inspection team with several excruciating hours of anxiety as they checked and re-checked the derivation of the ritual to be certain that it shouldn't already have ended - and serious puzzlement when it did show up. Where had it been, anyway? Why bother sticking one piece of soul so far away when all the others were so nearby?
Regardless, it was done. The panicked pig shuffled about as the goblins closed in with their knives, all too aware of the bindings that prevented its contents from escaping into new vessel. "The rewardsss I could give you," it hissed in an almost-human voice - not too surprising, given magic; even some Animagi had learned to force their animal forms to speak, giving Muggles some very peculiar incidents over the course of humanity's existence. "Foolsss - you dare not-"
"We dare," an inspector said curtly, and struck.
Afterwards, the body was burned and the ashes scattered over the ocean. The ritual room used was ceremonially cleansed and quarantined for seven lunar months before its next use - for nothing so dramatic, fortunately, but rather for removing several noxious curses on items bought by the prior owner from Borgin & Burkes, said owner having been miserly enough to appreciate the ridiculously low prices yet witless enough to not appreciate the implications. The Lestranges quietly died in Azkaban - nothing at all unusual for life-sentence inmates. Their property went to a distant cousin in France, who would make the news a few years later for his fervent advocacy of tighter regulations on magical creatures after (he claimed) a criminal ring of half a dozen Veela conspired to rob him of his wealth. He was laughed out of the political arena by witches sneering that it didn't take magic to make an idiot blow his inheritance on loose women and wizards mockingly asking him for the contact information of this vaunted criminal ring ("solely for personal purposes"), and that was the end of the Lestranges as a family of any note.
The goblins never did verify who they'd dispatched, but the reports of Dark Marks suddenly vanishing the same night as the swine's demise gave them cause to wonder. Best not to know. Considering how hysterically the Wizarding public had reacted to a baby supposedly "defeating" the Dark Lord (when it was obviously the child's parents who had done it, albeit at the cost of their lives), the news that mere goblins had dared to dispose of one of their greatest wizards (hated or not) would send them into an existential panic. Wizards' existential panics tended to have significant body counts attached for the subjugated races. Again: best not to know.
All that mattered was that the threat was eliminated and, in unrelated news, Lord Voldepork - ahem: Voldemort - never rose again.
All was well.
Author's Note: A sketch of the future:
Harry alarms Mrs. Figg when, after leaving the room to check on one of her cats, she comes back to find the boy passed out on the floor with a bleeding forehead. She reports to Dumbledore, Dumbledore is baffled but immensely relieved that the boy no longer seems to be a Horcrux, and Harry, for the time being, returns to the Dursleys. Events mostly remain unchanged until he goes to Hogwarts, where he leads a peaceful and sedate life.
With the destruction of the Horcrux in Ravenclaw's diadem, the curse upon the Defense position loses its anchor and fades away. The final teacher to suffer from the curse lasts two years rather than one, opting to leave when health problems induced by accidents in her first year as teacher grow too great, and Severus Snape snaps up the spot. To general surprise, he's actually well-suited to it.
The diadem itself is rediscovered years later, when a Ravenclaw fifth-year seeks refuge in the Room of Hidden Things to escape her Housemates' bullying.
In light of the Lestranges' malfeasance, the goblins quietly investigate whether Sirius Black was framed in order to hasten his death and Bellatrix's (now Narcissa's) inheritance of the Black family wealth. Enough evidence surfaces to call the initial imprisonment into question (at least, by Pureblood standards), Sirius ultimately walks free (and begins taking action to gain custody of his godson), and the goblins regain a valued customer.
Dumbledore is confounded by Voldemort's failure to reappear and comes up with all sorts of wild theories, including Lily's love-protection remotely finishing Voldemort off and Voldemort faking his own death to conspire in secret. His obsessive worrying will be reputed to have driven him to an early grave, though a nasty and persistent rumor will hold that he deliberately brought about his own death after coming into possession of a strange ring adorned with an ugly black stone.
Hope readers enjoyed.
EDIT: Sorry about the formatting error at the end ["an ugly readers enjoyed"]; I swear this site eats chunks of text sometimes. The reviewer who said Harry ought to have gone to Sirius after his freedom is correct - I originally had trouble figuring out why Sirius would go free and failed to edit Harry's text after I came up with an explanation. That is now changed.