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.
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.
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.
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.
If everyone abandons Harry fanfic, it would likely lead to a significant decrease in the production of new works related to it. Fanfic authors might shift their focus to other fandoms. Also, the online communities centered around Harry fanfic would become less active, with fewer discussions and exchanges of ideas.
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.
I'm not sure of a specific 'lily abandons harry fanfic' off the top of my head. But you could try searching on popular fanfic websites like Archive of Our Own. They have a vast collection of Harry Potter fanfics, and you might find one with that theme there.
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.