A slightly simpler plot, but one with a fair amount of potential.
Around Year 5, Harry, Dumbledore, Voldemort, and numerous other wizards on both sides and across Earth determined to have combat potential... Are teleported to an alien starship. The aliens (Let's call them the Starfarers) explain things pretty simply: They are at war with a race of genocidal aliens. These other aliens are completely different in even their base chemistry, like some kind of Eldritch abominations, that want to wipe out all carbon based life.
The Starfarers have one trump card: Magic, which is something they have tried to duplicate. Alas, only humans are able to wield magic or generate magic users. The Starfarers have taken magic users from Earth before as this war has been going on for centuries-Usually just a few, a dozen maximum. But they're at the point where they need an entire army of magic users to win this thing, so they're basically drafting as many witches and wizards as they can.
The Starfarers do not care about the local issues the Wizards have, because if they lose this war, Earth will be enslaved or destroyed. So they'll use every powerful magic user they can lay their hands on. And so, the wizards will have to find a way to get along and win this thing, or die trying.
No pressure.
If Voldemort and Dumbledore's factions and other factions of wizards can't work together and with the aliens, Earth is fucked.
... That said, the Starfarers will probably need to be... Persuasive, at first.
Voldemort: "You cannot command me, you simple, magicless creatures! I am Lord Voldemort, and I will-GRRRRAAAAYYYAAAARRRGHHH!" *He twitches and shakes, before falling, twitching, onto the deck*
The Starfarer representative, an attractive humanoid woman with green skin, is nonplussed.
Starfarer: "We also injected some of the more... Unreasonable of you with controls. To ensure compliance."
Voldemort: "You-You cannot possibly-GRARRRRGGGHHHH!"
Starfarer: "At the moment the controls activate when Lord Voldemort attempts to use magic."
Voldemort: "YOU INFERIOR-AAAARRRGH!"
Starfarer: "Or insults anyone."
Voldemort: "I WILL KILL-GYYYAAHHH!"
Starfarer: "Or he feels murderous."
Voldemort: "Haa... Haa... Haa-AAARRRRRRGGGGHHHH!"
Starfarer: "Or if I feel like it."