Elaborating more on Kelly resenting Fred for being Sam's replacement because it's a fun avenue to explore.
Kelly is a complex character and she's never given a bigger spotlight in the lore and it's sad but we do know she's very emotionally complicated. She's the most emotional member of Blue team and the most willing to express those emotions.
In some ways we actually see John relying on Kelly and her feelings in order to gauge a situation and it's another small nuance we don't get to see explored very well.
From Kelly's perspective she's very much seen John and Sam as her two closest friends. Even after Blue team expanded to add more members. The Blue team roster always changed when it came to extra members but the core of the team stayed the same. It was always John, Sam, and Kelly.
Sam was always the more light hearted and joking member of the three. He helped relieve tension by joking and not being so incredibly serious. He was still serious just not on the same level as John and Kelly. He balanced out their little trio, being the most outgoing and friendly of the three. If it wasn't for Sam Blue team would have had a rough time accepting new members to the team.
In a way we see this after Sam's death when Kurt joined Blue team and he had a hard time fitting in. In a way the core of Blue team had changed and had become more closed off to new members. After that the Blue team roster really didn't change like it did in the past. It was always John, Kelly, Fred, and Linda.
We know that John and Kelly didn't really get the chance to mourn and heal from Sam's death. And that the only way they know how to deal with grief is to push themselves with more and more missions. While I do think they sat down and cried about his death neither of them got the chance to heal.
Fred and Sam are fairly similar in terms of personality, although Fred is more serious like John he's still pretty friendly and able to crack jokes that the others wouldn't. I think in a way this rubbed Kelly the wrong way because Sam's body wasn't even cold when Fred became a permanent Blue team member.
Where Kelly was used to Sam joking suddenly it was Fred cracking the jokes and she didn't like it. Hence why we see her threatening him when he jokes. In a way I think John knows this and does his best to intervene but he doesn't really have the people skills to smooth it over.
She doesn't like that Sam is dead and suddenly he's being replaced with a guy who acts very similarly. But she has no real way to work through these emotions and in a way they never get resolved. She does eventually accept Fred as a member of Blue team but deep down still harbors those emotions towards him.
Of course when John is gone she respects him as a leader but never sees him as the true leader of Blue team. Some of those old resentments come up as now he's replacing both Sam and John. She has a hard time coming to terms with it but is better at burying her emotions now and in a way just forces herself to get over it. Forcing herself into her work and going on missions. Anything to stop the grief of losing her two best friends.