Maybe he's frustrated with her lack of progress in combat compared to him and Sasuke. He could also be in a bad mood and say it without really meaning it.
One possible reason could be that Naruto has seen Sakura make mistakes during a crucial mission. He might think that she's not pulling her weight or being as effective as she should be. Another reason could be that he's comparing her too much to their other teammates and seeing her as the weakest link at that moment. It could also be that he's just having a moment of immaturity and not thinking about how his words will affect her.
Well, it could be that in this fanfiction, Naruto has some sort of hidden agenda. He might call Sakura ugly as a form of reverse psychology. He could be thinking that by doing so, she'll prove him wrong and become more confident. Or perhaps there's some miscommunication or misunderstanding between them. For example, Naruto misheard someone talking about Sakura in a negative way regarding her looks and he wrongly believes it, so he says she's ugly.
One possible reason could be Naruto's out - of - control power. If in the fanfiction Naruto has some new and extremely powerful abilities that he can't fully manage, Sakura might see him as a monster out of fear. For example, if he accidentally causes destruction while trying to save the village.
One reason could be that they are comparing her to the more physically powerful members like Naruto and Sasuke. Naruto has the Nine - Tails' power and Sasuke has the Sharingan. In comparison, Sakura's initial abilities seem less flashy. Another reason might be that they haven't seen her full potential yet. Maybe she hasn't had a chance to show off her improved combat skills or her advanced medical ninjutsu in front of them.
One reason could be that Naruto has always been more attracted to those who understand his outcast past better. Sakura doesn't really have that kind of connection with him as she comes from a more normal background. So there's a lack of that fundamental understanding between them which hinders any romantic feelings.
In some fanfictions, it could be due to unrequited love. If Naruto has deep feelings for Sakura but she continuously rejects him in a cruel or thoughtless way, Naruto might feel angry enough to seek revenge. For example, she could publicly humiliate him for his feelings, which would hurt Naruto deeply and lead to thoughts of revenge. Another reason could be a misunderstanding. Suppose Sakura is misjudged by Naruto as having done something terrible when in fact she was innocent. But Naruto, in his ignorance, decides to take revenge. This can create a lot of drama and conflict in the fanfiction.
One possible reason could be that she sacrifices herself to save Naruto from a powerful enemy. In the heat of battle, she might put herself in harm's way to ensure Naruto's survival.
One possible reason could be that Naruto has a different love interest in his heart, like Hinata. In the original story, his relationship with Sakura was more of a friendship - like bond. Another reason might be for the sake of creating an unexpected plot twist in the fanfiction. Maybe the writer wants to explore different emotional and relationship dynamics that don't follow the typical Naruto - Sakura pairing.
Maybe Naruto realizes that his feelings for Sakura are not as strong as he once thought. In the fanfiction, he could have met someone else or had an epiphany about his own emotions. He might leave Sakura to find his true self and explore different relationships.
One possible reason could be that Sakura realizes she has different goals or values that are not compatible with being around Naruto. Maybe she discovers a new path in life that doesn't involve him, such as focusing on her own medical ninja career without Naruto's chaotic lifestyle interfering.
She might have realized how much Naruto has sacrificed for her and their friends. His selfless acts could have made her feel that she needs to protect him in return.