Romance with horror/dark dramatic elements: Dark things happen along the way but the romance is still the focal point. Example: Two lovers getting by in a dystopic world. Somewhere along the line, one of them sustains a grave injury, but survives. At the end of the day, they may not have a perfect world to live in, but things are looking up and they still have each other and that is the greatest gift, and more than enough to motivate the injured person as they learn to live with their scars (or lost limbs. Whatever the injury may be lol).
If the case in a story is like the above but the romance isn't the primary focal point, but one of a few focal points, then you can still add romance as one of the story's genres.
Example of tragedy with romantic elements: Two lovers try to get by in a dystopic world, and just as they're about to save the day, one of them dies for the cause. They may have reached their goals, but their happily ever after is not achieved.
Tragedy with romantic elements can also end in one of them dying and their goals not being achieved.
Both a romance with dark elements and a tragedy with romantic elements can end bittersweet, but the primary divider is whether or not they get their ever after.
Hell, the divider isn't even if one dies lol. If ghosts exist in your story and your lovers can keep their ever after that way, it can still classify as a romance.
Romances don't have to be happy go lucky. There's a lot you are allowed to do within a genre, but if you break the main genre definitions it's kinda not that genre anymore??? Which is fine. Just call it what it is instead lol