Depending on the terms of the rights contract, the studio generally needs to produce some qualifying product every so many years in order to retain the rights to do so. The contracts vary and may include lesser productions such as straight-to-DVD or television productions as well.
So long as the production meets the requirements of the contract, then the rights are retained. It does not generally matter what the quality is. There could be some sort of "quality" clauses, but they are hard to enforce. It's like the Marvel contract with Universal Studios - there are maintenance clauses, but they are subjective so they can't just say, "Hey, we don't think you are maintaining well enough. Ours now!"