One possible reason could be to protect them. In many fanfictions, Harry might believe that by distancing himself from his friends, he can keep them out of danger. For example, if there is a new dark threat targeting him specifically, he may think that the enemy will use his friends against him.
One consequence could be a breakdown in their friendship. His friends might feel hurt and start to distance themselves from Harry. For example, Hermione, who is very loyal, might be deeply offended if Harry constantly doubts her.
In some fanfiction, the author might create a plot where Harry has been betrayed before. So, he has trust issues even with his friends. For example, if he was tricked by someone who seemed like a friend in the past, it could make him more cautious and less trusting in new situations with his real friends.
Well, usually in such fanfictions, Harry might face a lot of emotional turmoil and have to find his way alone to overcome the betrayal and the challenges that come with it.
The Ministry of Magic could also be the main antagonist in this case. If the Ministry is corrupted or under the influence of dark forces, they could manipulate Harry's friends. They might convince his friends that Harry is a danger to the wizarding world order, and his friends, being naive or misinformed, end up betraying him.
Some friends might be angry at first. They could feel abandoned without really understanding Harry's motives. For instance, Ron might be frustrated and feel that Harry is being selfish by leaving without a proper explanation.
Later, he could become depressed. Harry has always valued his friends highly, so losing them would be a huge blow. He might isolate himself in his dormitory, not participating in school activities as much. He would probably be constantly thinking about what went wrong and how to fix it.
One possible plotline could be Harry feeling extremely isolated and trying to find new friends outside of his usual circle. Maybe he starts to focus more on his studies and discovers new magical abilities on his own.
He could meet new witches and wizards from different cultures. For example, he might run into a powerful African wizard who has unique magical abilities related to nature magic. Or he could meet a Japanese witch who specializes in charm - making that is based on ancient Shinto beliefs.