I think there are lots of games where the mechanics are shitty, but the story is good.
Cyberpunk 2077 is the most recent and most prominent example. It has a good story (or lets say the story is done in a good quality, whether you like the story or not is something else), but the mechanics are absolutely horrible. There isn't a single element of the mechanics which works decently.
Mass Effect 1 and maybe also ME 2 were in the same boat. Witcher 1 probably as well.
Going away from RPGs a bit for a thought experiment, and just thinking of adventure games and walking simulators, which basically have no mechanics. They can be great too (if you enjoy the story ofc). But now if they had a really great story, but also some really bad mechanics, which stay in the background enough so that they don't kill the experience you get from the story - they would still be decent games I guess.
Of course if the mechanics are so bad AND they have such an importance, that it gets a frustrating mess, then yeah…good story wont help.