Whenever I want to use comedic lines that work in serious scenes first thing I'd do is define the context of the scene. The second thing I'd do would then be to define is the purpose of the line. Finally, the rest is up to the execution in reaching that line.
Here are some lines:
- "I admit, I am an idiot, but you're also an idiot too!" (Ex. Context: A duel to the death between two rivals with different beliefs)
- "You're just throwing tantrums." (Ex. Context: The protag tries to take down a villain lord with tragic backstory)
- "You had one job!" (Ex. Context: The protag gets scolded by his teammates after letting one of his members die due to sheer ignorance)
- "You're kidding right?" (Ex. Context: An important side character betrays the protag)