Perhaps he was deceived. There might be a powerful dark wizard who managed to convince Harry that the dark side had a more 'just' cause. This wizard could have used false information about the history of the wizarding world and how the dark side was initially misjudged.
It completely flips it. Instead of being the hero we know, he becomes a figure of fear and suspicion. His actions would shock those who knew him, as he was always seen as the one to fight against the dark, not join it.
The Ministry of Magic could be the ones to betray Harry. They might try to use Harry as a pawn in their political games, and when Harry realizes this, he loses faith in the so - called good side. Voldemort then takes advantage of Harry's disillusionment and convinces him to join.
The teachers at Hogwarts, like Dumbledore (if he were still alive in the fanfic), would be deeply concerned. Dumbledore always saw great potential in Harry for good. He would probably try to understand what led Harry to this path and would use all his wisdom and magic to try and turn Harry back. The other teachers would also be on high alert, fearing for the safety of the students and the future of the wizarding world.
In this fanfic, Harry might be betrayed by the Order of the Phoenix. They could have made a decision that endangered Harry's life without his knowledge. Feeling used and discarded, Harry runs away. Voldemort, through his Death Eaters, finds Harry and manipulates him. He tells Harry that he can give him a place where he will be respected and not betrayed again. Harry, still young and naive in some ways, falls for Voldemort's lies and joins him, leading to a very different kind of war in the wizarding world.
Hermione could be the one. Maybe she gets jealous of Harry's fame and power, and starts spreading lies about him, which leads to his betrayal. As a result, Harry feels so hurt that he turns to Voldemort.
In such a fanfic, perhaps Harry Potter is magically manipulated. The Dark Lord could use some powerful dark magic to cloud Harry's judgment. Harry might then start to use his skills and knowledge, which were originally meant for good, to help the Dark Lord's evil plans. For example, he could use his Parseltongue ability to communicate with dark creatures for the Dark Lord's purposes.
Perhaps Harry is betrayed by the wizarding world as a whole. The Ministry of Magic wrongly accuses him of a serious crime. With no one to turn to, Voldemort approaches Harry. Voldemort shows Harry a world where he can be in control, instead of being at the mercy of those who have turned against him. So, Harry decides to join Voldemort out of desperation and a thirst for revenge against those who betrayed him.
Dumbledore could be seen as the main antagonist from Harry's new perspective on the dark side. Dumbledore represents all that is good in the wizarding world, and if Harry has turned to the dark, Dumbledore would be the one trying to stop him, to bring him back to the light. So in this context, Dumbledore becomes the opposition that Harry has to face.
Well, perhaps Harry gets tired of being constantly in danger and feeling unappreciated in the wizarding world. He might be lured by the Dark Side with promises of power and safety. Voldemort could offer him a place by his side, showing him a different view of magic that seems more appealing in a warped way.