He might initially be confused. Harry could keep trying to engage with his friends as usual, not really understanding why they are being cold towards him.
One reason could be a misunderstanding. Maybe Harry said or did something that his friends misinterpreted. For example, if he was overheard making a comment that seemed critical of them but was actually taken out of context.
Hermione would usually be very worried and immediately start looking for ways to heal him. She might use her knowledge of magic to find the right spells or potions to treat his injuries.
If his friends continue to ignore him, Harry could become sad and withdrawn himself. He might start to isolate more, spending time alone in places like the Forbidden Forest or an empty classroom. He might also lose his confidence in himself, thinking that he is not worthy of their friendship. In his loneliness, he could focus more on his studies or some solitary magical pursuits, trying to distract himself from the pain of being ignored.
He would probably try to figure out what went wrong. Harry is a curious and determined character. He might start to recall recent events to see if there were any signs of his friends' discontent. He could also try to reach out to them, either directly or through mutual acquaintances, to ask for an explanation.
At first, Harry would be in disbelief. He would think it was some sort of joke or misunderstanding. But as the reality sets in, he would become a bit of a loner. He'd still have his sense of right and wrong, so he might continue to fight against the dark forces on his own, all the while hoping that his friends would come to their senses and realize they made a huge mistake in betraying him.
Another way she could react is by distancing herself completely. She would stop trying to be part of their group and start creating her own identity at Hogwarts. She might explore parts of the castle she's never been to before, find new study nooks, and interact with students she's never really talked to, all while trying to forget about Ron and Harry's cold treatment.
His friends would react in a very concerned and protective way. Hermione would use her intelligence to find the best solutions for his recovery. She might also try to figure out what went wrong on the mission to prevent it from happening again. Ron would be there for Harry no matter what, showing his loyalty. Ginny, being Harry's love interest in many fanfictions, would be extremely emotional. She would be a strong presence by his side, making sure he has everything he needs. The rest of his friends would also come together, forming a support network around Harry, sharing memories and positive thoughts to help him through the tough time of recovery.
He might be initially heartbroken. Harry has always been a bit of an emotional person, so he could go into a state of depression for a while. He might isolate himself from his friends and focus only on his studies or fighting against the dark forces, using it as a way to distract himself from the pain of the rejection.
He might be very sad at first. Harry has always valued his friends, so being forgotten by them would be a huge blow.
Hermione would probably be very cautious at first. She would be worried about the potential danger that Tom Riddle could pose, even as a child. But she might also see it as an opportunity to study the roots of dark magic and how to prevent someone from turning to the dark side.