One possible plot could be that after some sort of danger at Hogwarts, perhaps a new dark threat, Dumbledore decides that Harry would be safer living with McGonagall. McGonagall, being strict but fair, would impose a strict study regime on Harry. She'd also teach him some advanced magic that he might not learn in regular classes. Harry would get to see a different side of her, like her love for cats which could lead to some comical moments as he tries to interact with her Animagus form.
Living with McGonagall, Harry would become more empathetic. He'd see her as a mother - like figure who has her own struggles and joys. This would make him more in tune with the feelings of others. His magical abilities would also develop in a more refined way. McGonagall could introduce him to some of the more complex and ancient spells, which would require him to be more patient and precise in his magic, thus shaping his character to be more focused and detail - oriented.
She might use her magic skills to shield Harry from physical harm. For example, she could cast protective spells like a strong shield charm when Harry is in danger from dark wizards. Also, she may use her authority in Hogwarts to keep him away from those who wish to harm him, like making sure he is not alone in dangerous areas of the school.
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.
Perhaps when Harry is wrongly accused of something, and McGonagall uses her influence and knowledge to prove his innocence. She stands up for him in front of the whole school or the wizarding authorities, which is a very significant moment of her protecting Harry.
She might give him harsher punishments than other students for the same offenses. For instance, if Harry is late to class, she could give him detention while letting others off with a warning.
It could be that in the fanfic's plot, McGonagall has some past connection to Harry's enemies. So, her hatred towards Harry is a result of her loyalty to those she has a history with. This would create a lot of drama and conflict within the fanfic's story.
Harry might be initially shocked and confused. He has always seen McGonagall as a reliable figure in his life at Hogwarts, so her abandonment would be a huge blow to him.
I'm not sure if there is a specific fanfic with that exact plot. Fanfiction can cover a wide range of ideas, but this one seems quite unusual. Most fanfics tend to focus on more traditional themes like Harry's adventures at Hogwarts, his relationships with his friends, or the fight against Voldemort. However, in the huge realm of fan - created content, it's possible that something like this exists, but it's not likely to be very popular.
One great fanfic could be about Harry and Hermione getting unexpected advice from McGonagall regarding the Goblet of Fire. Maybe McGonagall suspects some foul play early on and warns them to stay away from it, but their curiosity gets the better of them.