Suits by the United States to vacate and annul any patent to lands erroneously issued under a railroad or wagon-road grant shall only be brought within six years after the date of the issuance of such patents. But no patent to any lands held by a bona fide purchaser shall be vacated or annulled, but the right and title of such purchaser is hereby confirmed: Provided, That no suit shall be brought or maintained, nor shall recovery be had for lands or the value thereof, that were certified or patented in lieu of other lands covered by a grant which were lost or relinquished by the grantee in consequence of the failure of the Government or its officers to withdraw the same from sale or entry.