I think genuinely Dennis was mad on trinity’s behalf but halfway through getting mad realized that Trinity would actually hate it even more if Dennis tried to fight her battles. It seemed like an out of nowhere fight but imagine Dennis frustrated by Frank stereotyping him- how many times do you think Dennis has had that exact conversation with his coworkers? It’s not even the first day Frank is meeting him (though I know people forget things, it’s been 10 months), Dennis frustrated that he’s lost something important of his and is being distracted by comments on his body??? Possibly stressed about contacting Amy, and obviously upset that Frank was an absolute asshole to Trinity and has yet to apologize.
It’s the kind of scenario where you know someone’s true colors but you’re not supposed to know, so it’s really hard to navigate them being/acting nice when you know they really aren’t. He just exploded and realized, Frank doesn’t really know why he’s upset at him so Dennis is coming across as irrational. Dennis did apologize after so he must realize how he came across and that the argument was unnecessary.