It could be due to the destruction of something he holds dear. For instance, if the Air Temples, which are his cultural heritage, are further damaged or desecrated. He has a deep connection to his Air Nomad roots, and any harm to the remnants of his people's history would be extremely painful for him. Also, if he loses his connection to the spirit world somehow, that would be a great source of heartbreak as it is an important part of his identity as the Avatar.
One possible reason could be unrequited love. Maybe he has strong feelings for a character who doesn't feel the same way about him. For example, if he has a crush on Katara but she falls for someone else. Another reason might be the loss of a close friend. If Zuko or Toph were to sacrifice themselves to save the world, Aang would be heartbroken as they are his dear friends. Also, if he fails in his duty as the Avatar to protect the world from a great threat, he could feel a deep sense of heartbreak and failure.
In fanfiction, Aang could be heartbroken if he discovers a betrayal. Suppose he trusts someone completely, like a new ally he meets on his journey, and that person turns out to be working for the Fire Nation in secret. This would shatter his trust and break his heart. Or perhaps he has a vision of a dark future for the world where all his efforts as the Avatar have been in vain. The thought of such a hopeless future could leave him heartbroken.
Maybe in the fanfiction, Aang leaves Katara because of a misunderstanding. For example, he could misinterpret something Katara said or did regarding their relationship. This misunderstanding could lead him to believe that it's better for both of them if he goes away. He might think that he is protecting Katara in some way by leaving.
Self - discovery is also a theme. Through the heartbreak, Aang has to reevaluate who he is and what he wants. He may question his purpose as the Avatar or his ability to love. This can lead to him growing and changing in unexpected ways in the fanfiction.
There's a fanfiction where Aang is heartbroken after a big battle. His friends don't fully understand his pain at first. The story focuses on how he copes with this heartbreak alone and then gradually opens up. It shows his growth from the experience. I can't recall the exact title though.
One possible reason could be the loss of a dear friend. Naruto values his friends deeply, and if he were to lose one, it would break his heart. For example, if Sasuke were to die or turn against him completely in a way that Naruto couldn't fix, it would be a huge blow.
In a girl heartbroken story, perhaps she had high hopes for something that didn't come to fruition. For example, she might have dreamed of getting into a certain school or getting a particular job and then was rejected. It could also be that she was bullied at school or in her social circle. Constant mean remarks and exclusion can really shatter a girl's heart.
Perhaps Aang has a vision of the future where Katara is happier without him. So, in the fanfiction, he decides to respect that future and let her go.
Maybe Zuko has his own goals that don't involve chasing Aang. He could be more focused on redeeming himself in other ways, like helping the Fire Nation people or learning about different cultures without the need to pursue Aang.
The writer might be trying to add some drama to the story. By making Aang hate Katara, it creates a conflict that can drive the plot forward. For instance, their friends might have to work hard to resolve this hatred and restore their friendship.
One possible plotline could be that Percy has been betrayed by his closest friend. Maybe this friend revealed a big secret of Percy's, and now Percy feels isolated and heartbroken. He might start to question his relationships and his place in the world.
In some fanfictions, it might be part of a plot to create tension. The writer wants to show that their relationship isn't all smooth sailing. So, Katara hurting Aang can be a device to make the story more interesting. It could also be related to different character arcs, like Katara trying to become more independent and in the process, her actions accidentally harm Aang.