Metropolitan Life Insurance Co. and parent company MetLife Inc. defeated a proposed class action claiming they wrongly withheld up to $500 million owed to as many as 30,000 annuity customers.

The lawsuit was governed by contracts between Metropolitan Life and various employers that enlisted the insurer in providing retirement benefits to their employees, a federal judge said Jan. 15. Given the existence of valid contracts, the quasi-contractual claims raised by annuity recipient Edward Roycroft—including unjust enrichment and restitution—must fail, the judge said.

Roycroft accused the MetLife entities of not doing enough to locate and pay benefits to more than 30,000...