I am very new to tabletop DnD but regarding your last phrase...
Isn't that how alignment is supposed to work?
As I understood it - and bear with me as I am new to both CRPGs and DnD - alignment in video games sometimes (not always though) just kind of chooses what dialogue options you'll have available. Not exclusively limiting to the chosen alignment, and often with room for character development - but ex. if you're Neutral Good then you won't have that many dialogue options from the Evil spectrum. Obviously, the downsides and limitations of alignments in CRPGs is a lot more obvious when compared to the flexible pnp-RPing (where a DM is fully immersed in the particular story and thus, enable more RP options). Or at least so I thought?
As for tabletop (5e, since I have barely any knowledge and literally 0 experience with prior editions) - I just used my players alignment to somewhat grasp what kind of decisions they were making - I didn't care to bind them to anything, it was more so that I could vaguely write my story so it makes sense accordingly (no sense in trying to write a hero's story with tons of good aligned quests / side quests if everybody wants to play shades of evil etc). As for abilities granted by deities, I always had my players specifically chose (or that I, as a DM, chose for them, whichever makes sense from a RP perspective) a deity and their spell/action would just work accordingly.
Like you said - being endlessly merciful and benevolent might not be the answer to all good options, but that depends entirely on which deity the PC is channeling from. I kinda just assumed that this was a part of why one would have a DM - to create this living flexibility from alignments. Ex. my cleric is a follower of Lathander and whatever divine favors / disfavors he'll earn along the way is judged by my interpretations of Lathander's teachings - not some universal dilemmas.
As for the alignments themselves, on paper, I did not realize that they were supposed to be limiting in practice. I just had my players loosely chose an alignment in order to have something to lean back for roleplaying- with greater emphasis on lawful, neutral and chaotic than good, neutral and evil - and moreover, (like I mentioned) so that I have some kind of idea what kind of quests I can write for the story. In other words, I just use it as some kind of helping tool tip to stay in character(s).
That's great if you just want to use alignment as a personal tool to stay in character. Personally, I think there are much better tools than alignment for that. What does your character want most? What do they fear most? What do they hope to gain? What are they afraid to lose? What do they think their patron deity would want them to do? What principles do they value? '"My character is evil, so they do the evil thing because they are evil" makes for a much less interesting villain than "my character is terrified of watching her friends die and being powerless to help them. She will do absolutely anything in order to never feel that helpless again."
Regardless of how you choose to motivate your character though, you don't need a ruleset for that. The function of a ruleset is inherently limiting by its very nature. Most of the time that is a good thing. It is great for limiting how far you can run, how many times you can attack, how convincing you can be when you lie to that guard, etc. In the case of alignment mechanics, it is designed to limit what classes you can play, what equipment you can use, etc. It allows you to cast Detect Alignment on Karl Marx and Ayn Rand to determine who is good and who is evil, completely bypassing the need for any evaluation of what those concepts even mean.
And since good and evil are tangible absolutes that can be determined with a simple spell, there isn't really any room for characters to have differing opinions on morality, or ever question whether they did the right thing. This creates an environment where Evil deeds are always done by self-professed Evil villains who identify as Evil and seek to further the aims of Evil in the name of Evil.
A nuanced exploration of ethical dilemmas was stifled by RAW alignment mechanics, which I imagine is one of the reasons they are now fading into obscurity.