I tested this inversion against 3 known analytical abel pairs and found good agreement with this numerical solution. I found that with smooth data with good signal/noise, increasing upf provided a better answer.
I was able to get the code working by replacing lsqcurvefit with a standard non-linear equations solver and simply supplying the residuals. Everything seems to be ok but I still need to through a few theoretical test curves at it. Thanks!