There is a fairly big precedent to cite here - Romeo and Juliet. Considered one of the greatest romance stories of history. Does not have happy ever after in there (at the risk of spoilers for those who haven't had a chance to see it in the last 400 years or so, there are a couple of quite important MC deaths at the end

)
In my opinion, the greater the gulf between the MCs and the more they have to lose at the end the better the romance and if they do lose all, all the better
But in terms of modern publishers looking for romance titles, generally they state in their guidelines that they want HEA because that is what the readers expect. Romantic tragedy could be a different genre, I suppose... It is always a good idea to check the publisher guidelines to see what they want rather than work on generalalities. Some may specifically state that it does not have to end happily.
I did manage to sneak a tragic love affair into Transitions. On the surface, you may think that the modern day love tale which ends in HFN is our romance plot but its actually the tragic one that occurs in history which I consider the true romance
