One reason could be the stress of fighting Voldemort. Harry has so much on his shoulders, and McGonagall is a figure of authority and comfort. He might break down in front of her when the pressure becomes too much. For example, when he has to face difficult decisions like whether to sacrifice himself or when he feels responsible for the safety of his friends.
Maybe it's about his family. He misses his parents terribly. McGonagall often shows a maternal - like side towards the students. When something reminds Harry of his parents, like seeing a family photo in the castle or during a holiday when families are together, he could cry in front of her as she represents an older, wiser person he can turn to about his family pain.
She might immediately comfort him. McGonagall is a strict but kind teacher. She could put a hand on his shoulder and say soothing words like 'There, there, Mr. Potter. It will be all right.'
Maybe Harry is under a great deal of stress. He has so many burdens on his young shoulders, like fighting Voldemort, protecting his friends, and dealing with the secrets of his past. Snape has always been a rather intimidating figure to him, but in that moment, the pressure might just be too much, causing him to break down in front of Snape.
One reason might be that the fanfiction doesn't capture the essence of Mcgonagall as Harry knows her. He has a deep understanding of her from their time at Hogwarts, and if the fanfiction misses that, he won't like it.
It could also be due to some actions of McGonagall that seemed suspicious to Harry. Perhaps she made a decision regarding Hogwarts or Harry's safety that Harry didn't fully understand at the time. In the complex world of the wizarding school, decisions are often made with many factors in mind, but Harry might not be aware of all of them, leading to his distrust.
One possible reason could be that she is under some sort of dark magic influence. Maybe a spell has been cast on her that makes her act out of character and abandon Harry.
One possible reason could be that Harry is feeling extremely overwhelmed with the challenges he faces in the wizarding world. Sirius is like a father figure to him, so in front of Sirius, he can let out all the pent - up emotions. Maybe he's had a tough encounter with Voldemort or his Death Eaters, and the fear and stress finally break him when he's with Sirius.
One reason could be the alteration of McGonagall's personality. If in fanfiction she is made to be overly strict or mean, Harry, who knows her real character, would dislike this new version. In the original series, McGonagall was strict but fair, and any deviation from that in fanfiction might be off - putting to Harry.
Maybe in that fanfiction, McGonagall has some actions that Harry misinterprets. For example, she might be too strict with him in a way that he can't understand at that moment.
In lemon fanfiction, if McGonagall punishes Hermione, it could be due to violating school rules in a more extreme way than in the original books. For example, if Hermione gets involved in inappropriate behavior during a time when she should be studying or following Hogwarts' code of conduct.
It could also be that in the fanfiction, McGonagall has shown some form of bias. Maybe she seems to favor certain students or groups over others, and Harry, being the one who always stands up for fairness, starts to distrust her when he notices this behavior. He might feel that she is not as just as he once thought her to be.