In 2018, the real-life superhero U.S. Supreme Court Justice Ruth Ginsburg was the subject of a terrific film chronicling her amazing life and exceptional career.

“On the Basis of Sex” is not that movie.

That movie was the documentary “RBG,” and it should be screened in every middle school in America, and no matter what your age or political inclinations, I urge you to check it out.

Now, on to the disappointing news.

Mimi Leder’s “On the Basis of Sex” is a well-intentioned and occasionally inspirational but mostly flat and safe and cliché-riddled “origins story” about Ginsburg’s nascent career and her lifelong love affair with her husband Marty.

Our problems begin with the casting.

The British actress Felicity Jones and the ever-earnest Armie Hammer are fine actors, but neither seems particularly well-suited to their role.

At times Jones portrays young Ruth as a socially awkward fish out of water, fumbling about as if she’s in a period-piece “Legally Blonde” prequel; the next moment, Ruth is confidently delivering one of those made-for-the-movies speeches, putting the men in their place as the score swells to reinforce this PIVOTAL MOMENT.

Meanwhile, Hammer is such an imposing physical presence, even when he’s concealing his muscles beneath the tweeds of academia, he always looks as if he’s going to loosen the tie, whip off the sunglasses and spring into action.

It doesn’t help when the screenplay has Ruth nervously knocking over a glass or hemming and hawing when the spotlight is on her — only to find her confidence and turn the moment in her favor.

Not to mention the president of Harvard and other male authority figures portrayed as thin caricatures who are so dismissive of Ruth and any other woman who doesn’t understand her place is in the home, they’d make their fellow mid-20th century travelers Don Draper and Roger Sterling blush.

Not that sexism wasn’t an entrenched part of American life — and dozens of court rulings — at the time. As a straightforward procedural about Ginsburg’s time at Harvard Law, when she was just one of a handful of female students; a depiction of the almost tragically short marriage between Ruth and Marty, and a chronicle of Ruth taking on an “unwinnable” case that could overturn decades of sanctioned sexism in the workplace, “On the Basis of Sex” is almost always solid.

But “solid” is about as high as it goes.

The tone is set early, in a scene where Yale Dean Erwin Griswold (Sam Waterston) is hosting a dinner for the nine women just starting as first-year law students. Not even bothering to hide his skepticism and condescension, the dean says they’ll go around the table, and each of the women will explain WHY she even wants to study law. (Bet he never did that with any of the male students.)

Cue the moment where a skittish Ruth nervously fumbles about before suddenly finding her composure, looking the dean square in the eye and cutting him down with a sharp and sassy explanation.

Oh boy. You just made the wrong kind of dean’s list, Ruth.

There’s no doubting Ruth’s determination, dedication and downright heroic multi-tasking abilities. Already a mother of a toddler when she started law school, Ruth took care of Marty when he became seriously ill with cancer; attended all of HIS classes as well as her own (he was a year ahead of her) so she could essentially tutor him every evening; transferred to Columbia for family reasons; graduated first in her class; and kept on fighting, even after one law firm after another refused to hire her. (After all, she was married and had a child. How committed to the law could she possibly be? That was the rock-headed male mindset of the time.)

Justin Theroux hams it up all over the place as Mel Wulf, Ruth’s former childhood campmate who is now the gruff and off-putting and manic legal director of the ACLU. The ever-great Kathy Bates stops by as the groundbreaking feminist attorney Dorothy Kenyon.

Chris Mulkey does fine work as the classic sympathetic underdog always seen in these types of highly stacked legal thrillers. He plays an unmarried care worker who wasn’t allowed to take the tax breaks afforded to female caregivers.

Aha! say Ruth and Marty and the ACLU. If we can prove discrimination on the basis of sex in a case involving a MAN, it will set the precedent to strike down all the workplace policies with clear and deliberate discrimination against WOMEN!

Quite brilliant, and it really happened, and it really was a major stepping stone in what would be one of the most remarkable legal careers in American history.

If only this chapter of Ginsburg’s life had been told with a little more spark, a little more originality, a little more insight into what made Ruth RUTH.

‘On the Basis of Sex’

Focus Features presents a film directed by Mimi Leder and written by Daniel Stiepleman. Rated PG-13 (for some language and suggestive content). Running time: 120 minutes. Opens Tuesday at local theaters.