There are several potential reasons. If Harry were to show signs of being influenced by dark forces, Dumbledore would want to correct his path and might punish him to make him see the error. In fanfiction, perhaps Harry gets involved with a group that has questionable motives, and Dumbledore punishes him to keep him away from that. Additionally, if Harry were to neglect his studies and focus too much on other things like Quidditch or personal vendettas, Dumbledore could punish him to encourage him to balance his life better.
One possible reason could be that Harry breaks school rules in the fanfiction. For example, if he ventures into the Forbidden Forest without permission. Dumbledore is strict about the safety of students and such disobedience might lead to punishment.
Sexual fanfiction involving Harry Potter is inappropriate in the first place as it goes against the intended nature of the series. Dumbledore, as a moral figure in the original story, would likely be seen as acting in an ethical way to punish behavior that distorts the essence of the story and its characters. However, this is all within the realm of fanfiction which is not part of the official canon.
There are several possible reasons. Maybe Harry discovers a powerful and dangerous magical artifact and starts toying with it without proper guidance, which Dumbledore sees as a huge risk. Or perhaps Harry spreads rumors or secrets that Dumbledore has entrusted to him, and Dumbledore feels the need to discipline him to protect the safety and stability of Hogwarts. Fanfic authors often use such situations to show the complex relationship between Dumbledore and Harry and how they navigate through difficulties.
One possible reason could be a miscommunication. Maybe some evidence is misinterpreted, and Dumbledore thinks Hermione has broken a major rule. For example, if he thought she was involved in some dangerous magic experiments without permission. But this is a hasty conclusion for him to make.
One possible reason could be a misunderstanding. Maybe Harry overheard something that made him think Dumbledore was planning something against him that he didn't understand. For example, if he heard Dumbledore discussing a dangerous mission for him without his full knowledge.
One possible reason could be if Harry were to break a major school rule in the fanfic, like using dark magic without proper authorization. Dumbledore is a strict adherent to the rules of Hogwarts and would likely punish such behavior.
It could be that in the context of the fanfiction, Snape believes Harry has been disrespectful towards him or other teachers. For example, if Harry were to talk back or show disobedience in class, Snape would likely punish him as a way to assert his authority.
A possible reason could be jealousy. Maybe Harry sees Dumbledore getting all the praise and respect while he is the one doing all the dangerous work. So, he decides to expose some of Dumbledore's flaws to get some of that attention back.
Perhaps there are safety concerns for the students that Dumbledore is not addressing adequately. Harry, having a strong sense of responsibility for his fellow students, may feel that the only way to ensure their safety is to remove Dumbledore from his position. He might believe that Dumbledore's actions or inactions are putting the students at risk, and thus he takes matters into his own hands.
Well, it could be that Harry has a different view on how to handle the war against Voldemort. Dumbledore is often very strategic and sometimes keeps things from Harry for what he believes is the greater good. But Harry might think that full transparency is necessary. Also, Harry may have formed new alliances or friendships that give him different perspectives, and these new ideas conflict with Dumbledore's. He might feel that Dumbledore's approach is too old - fashioned or risky in a new context.