If the court fails or refuses, for any reason, to discharge a person as an insolvent debtor or remands a person to prison, and such person surrenders himself immediately to the sheriff, warden or keeper of the jail of the county, he may make out and deliver to the sheriff, warden or keeper a new inventory and new bond as provided by section 2A:20-2 of this title. Thereupon he shall be discharged from arrest or custody pursuant to sections 2A:20-2 and 2A:20-3 of this title, provided he brings a new action for his discharge, in which action the same proceedings shall be had for that purpose, as fully and effectually as if no previous action had been brought.
N.J.S. § 2A:20-11