Flagstar Bancorp lost the confidence of at least one analyst who questions the mortgage bank's ability to repay Troubled Asset Relief Program funds as it struggles with legacy mortgage issues.

In addition, Flagstar remains challenged by declining refinancing volumes and tight competition on the origination side, a research report concluded Wednesday.

Analyst Kevin Barker with Compass Point Research & Trading made those assessments of Michigan-based Flagstar (FBC) Wednesday after giving the bank a "sell" rating and setting its target share price at $12 per share.

Barker is not completely down on Flagstar. In fact, he says, if origination volumes "were to remain elevated and the company could grow market share in the face of increasing competition," it's possible Flagstar could heal its own legacy credit issues and repay funds owed to TARP.

But his confidence in the bank's ability to due so is tarred somewhat by declining margins and slower refi volumes.

"The company still has a ways to go before it can successfully declare it has moved past its legacy credit issues," Barker added. "This would likely limit Flagstar's ability to grow capital levels enough to successfully convince regulators the company can payback TARP without raising equity before the preferred dividend increases to 9% in February 2014."

This research comes after HousingWire reported that Flagstar was ordered to pay bond insurer Assured Guaranty (AG) $90.1 million in damages for failing to ‘repurchase or cure’ defective mortgages that Assured ended up covering as the mortgage-bond insurer.