Missy Franklin, the darling of the 2012 London Olympics and an erstwhile poster child for USA Swimming, finished the Rio Games labeled a disappointment. The swimmer who dazzled four years prior left Brazil with a single medal, earned as a prelims competitor but won while she watched poolside as U.S. teammate Katie Ledecky ran down the Australians for gold.

What went wrong? Well, theories abounded.

Was it her decision to leave college early to become a professional? Being overcommitted to sponsors? A change in coaches and training locations? In Rio, she said she wished she “had an excuse, but I don’t, and I’m not going to make up one.”

Turns out, she may have had one all along, she just didn’t know it.

Franklin announced Wednesday afternoon on social media that she had undergone separate surgeries on both shoulders to remove a buildup of scar tissue as a result of bursitis, an inflammation of the bursa, a fluid-filled sac that helps reduce friction between bone, muscles and other tissues, and is not uncommon in swimmers.

Franklin said she got the diagnosis in January following an MRI exam and underwent surgery “earlier this year,” according to her post.

The 6-foot-2 Colorado native, who hasn’t competed since Rio, entered last summer’s Olympics as one of the most recognizable names in swimming. She had won five total medals — four gold — at the 2012 London Games and followed up that performance with six more gold medals at the 2013 FINA World Championships in London.

But in the ensuing years, she never quite flashed the same brilliance in the pool and struggled while remaining in the sport’s spotlight.

In 2014, she was plagued by back spasms before and during the Pan Pacific Championships and failed to win an individual gold medal, settling for a bronze in one of her marquee events for the first time since her first international meet. The following summer, in need of a positive performance to springboard her into an Olympic year, she again fell short of the top of the podium at the world championships and left with individual silver and bronze medals in events in which she was still the reigning Olympic champion.

In Rio, after nearly a week of disappointing performances, Franklin was left sobbing in the water after failing to reach the final in her last individual event.

“I’m just trusting that God has a plan and a purpose and he’s going to make something beautiful out of this,” she told The Post in Rio, “even though I really wish I could ask him what that’s going to be right now.”

Since then, Franklin seems to have moved on. In January, she wrote in an article for the Wall Street Journal that she “had to come to grips with failure, and it wasn’t an easy time,” acknowledging that it was made all the worse since it “had occurred in front of billions of people.”

Her surgeries behind her, she has already returned to limited training — back at the University of California, where she swam collegiately — but will not be competing yet, likely ruling out any shot at making an eighth straight U.S. national team at World Trials in June. But in swimming’s four-year Olympic cycle, that doesn’t mean much for her career, and according to Franklin, she’s got more to accomplish.

“I’m so far from being done with this sport,” she said on Facebook, “and so far from being done fighting to be the best I can be.”