It could be Perry the Platypus, in a really unexpected turn. Maybe Perry has to keep some secrets from Phineas for his spy work, and one day those secrets are revealed in a way that makes Phin feel betrayed. This would definitely make him mad.
You can start by looking on fanfiction websites like Archive of Our Own (AO3). It has a large collection of various fanfictions, and there's a good chance you'll find some for Miles and Phin there.
One popular type could be adventure - themed ones where Miles and Phin go on an exciting journey together. Maybe they are exploring a mysterious new land or trying to solve a puzzling mystery.
Maybe Phin gets mad because Ferb keeps taking over their projects without much consultation. Ferb is often very methodical and might start changing things in their grand plans, which makes Phin frustrated.
One possible plot could be that Phin gets dysentery right in the middle of planning one of their big summer projects. This forces Ferb to take over the leadership role while also trying to nurse Phin back to health. The other kids might be confused at first about what's wrong with Phin, but then they all pitch in to help.
Well, in a Phineas and Ferb fanfiction where Phin gets dysentery, it could be a really interesting take on the characters. Dysentery is a serious illness, so it might make the usually upbeat and energetic Phin very weak. Ferb would likely be by his side, worried. And perhaps the other characters like Isabella and the gang would also come around to support Phin, bringing him things like soup and trying to cheer him up while he recovers.
Another possibility is that in the fanfiction, Phin gets mad when someone from their school, like Buford, teases Ferb too much. Phin is really protective of Ferb. So when Buford makes fun of Ferb's accent or his quiet nature, Phin could get really angry and decide to teach Buford a lesson.
Isabella might also be involved. She has a crush on Phin. So when he gets mad, she could come over and offer her support. Maybe she'll bring some of her Fireside Girls cookies to cheer him up.