For me, it's when the objective or goal is SO CLOSE but the characters fail anyway. Maybe they were just seconds too late, or it wasn't enough, or they were wrong in some way, or the objective was impossible to begin with.
For instance, a story where characters fought and suffered and struggled to get a cure for a dying friend but get there right after they've passed. You don't need gushing tears or a body wracked with sobs to get the point across then. The buildup is enough of a gut punch.
There's something about wasted or misguided efforts that get me. Seeing a character literally give their all and it's all for seemingly nothing. It's like Orpheus and Euridice failing right before they leave the underworld, or Marlin crossing the ocean for Nemo but he's (seemingly) already dead. Edward and Alphonse literally give everything to resurrect their mother, but it was impossible from the start. Icarus and Daedelus escape the labyrinth but fail anyway.
That's tragedy to me. That's a story that'll keep me awake at night.