Error analysis for refractive-index profile determination from near-field measurements