A party that has the right to declare a contract to be voidable pursuant to Section 23304.1 may exercise that right only in a lawsuit brought by either party with respect to the contract in a court of competent jurisdiction and the rights of the parties to the contract shall not be affected by Section 23304. 1 except to the extent expressly provided by a final judgment of the court, which judgment shall not be issued unless the taxpayer is allowed a reasonable opportunity to cure the voidability under Section 23305.1. If the court finds that the contract is voidable under Section 23304.1, the court shall order the contract to be rescinded. However, in no event shall the court order rescission of a taxpayer’s contract unless the taxpayer receives full restitution of the benefits provided by the taxpayer under the contract.