It could be that Peter's immaturity showed in a crucial situation. He might have been over - confident and tried something really risky without thinking it through. The Avengers, being more experienced, would be frustrated with his recklessness and thus yell at him. They want him to learn and grow, but his actions might have been too much to tolerate at that moment.
Peter might be very defensive at first. He could argue back, trying to explain his actions. After all, he is a teenager with his own ideas and he may think that the Avengers don't fully understand his perspective.
Stress and danger can also be reasons. When facing a powerful dark wizard or a difficult situation at Hogwarts, the pressure can get to them. Harry may yell out of frustration at not being able to find a solution quickly, and Hermione might yell back as she tries to keep him calm and rational. In a fanfic, this can create a lot of emotional turmoil and keep the readers engaged.
In some fanfictions, Snape might yell at Draco because he expects more from him. Draco is from a prominent pure - blood family, and Snape, being strict, wants Draco to uphold certain standards. Maybe Draco made a mistake in potions class, or he showed disrespect towards other students. Snape's yelling could also be a way to protect Draco from getting into more serious trouble in the dangerous Hogwarts environment.
One reason could be jealousy. If Nico is getting more attention from a certain character that Percy cares about, like Annabeth, Percy might get jealous and yell at Nico. He may think Nico is trying to steal Annabeth's attention on purpose.