One possible scenario could be that Hermione breaks a very important school rule in a creative way. For example, she might use a forbidden spell to save a friend in a dangerous situation but knows she has to face the consequences. Another could be that she feels guilty for not helping a classmate enough in a group project and wants to be punished as a form of self - flagellation. Or perhaps she accidentally damages a valuable magical artifact and willingly submits to punishment as a matter of principle.
Another scenario could be that Umbridge detains Hermione and makes her clean the classroom without magic. It would be a way to both humiliate and tire her out. Since Umbridge is known for her dislike of students who are too intelligent and outspoken like Hermione.
Perhaps in the fanfic, there is a curse within Shell Cottage that targets Hermione specifically. It could be an ancient, dark magic that was dormant until she arrived, and it slowly takes her life despite the efforts of her friends to save her. For example, it might start with strange symptoms like sudden weakness and then gradually lead to her death.
One possible scenario is that Naruto loses all his powers. He has been defined by his strength and his ability to protect. Without it, he may feel useless and worthless, leading to a desire to die. For instance, if he is cursed and loses his chakra completely.
Harry would probably be very confused at first. He knows Hermione is usually a rule - follower, so her wanting to be punished would seem out of the ordinary. He might try to talk her out of it, thinking there must be some misunderstanding. Ron, on the other hand, would be more straightforward. He'd likely say something like 'Hermione, you're mad!' and try to convince her that she doesn't deserve any punishment. The teachers, such as Professor McGonagall, would be taken aback as well. She would probably question Hermione carefully to understand her motives before deciding on any action.
One possible scenario could be that Voldemort punishes Harry Potter by using the Cruciatus Curse on him. In the wizarding world, this is a very cruel form of torture. Another situation might be that Voldemort imprisons Harry in a dark and desolate place, like the dungeons of Malfoy Manor. He could also force Harry to watch as he harms his friends, which would be a psychological form of punishment for Harry, who values his friends highly.
Another possibility could be that he is punished for being too reckless in a battle. He might put his teammates in danger, and as a result, face some form of punishment from his comrades or superiors.
In this kind of fanfic, one possible scenario could be that Harry uses his quick thinking and magical skills. For example, he might use a stunning spell on the troll just in time to stop it from harming Hermione. Another scenario could be that Harry lures the troll away from Hermione, using his knowledge of the troll's behavior. Maybe he throws something noisy in the opposite direction to draw the troll's attention.
Well, it could be that Draco betrays Hermione's academic trust. Since they are in a world where magic and knowledge are highly valued, he might steal her research or ideas for a spell or a magical discovery. This would be a huge betrayal as Hermione values her intellectual pursuits greatly. Also, he could betray her trust regarding a secret mission they are on together. He might abandon her in a dangerous situation, like in a dark forest full of dangerous magical creatures or in an old, enchanted castle filled with dark magic traps, just to save his own skin.
Perhaps in the fanfiction, Bellatrix stabs Hermione as a way to get to Harry Potter. She might think that by harming Hermione, she can draw Harry out and into a trap. Hermione is one of Harry's closest friends, so this would be a strategic move on Bellatrix's part.
Perhaps in a situation where a magical artifact is about to explode and destroy everything around it. Harry, being closer to it, decides to contain the blast instead of letting Hermione get hurt. His selfless act of heroism in this 'harry died for hermione fanfiction' is a way to show his deep bond with her, even if it means sacrificing his own life.