Other tools often use the function unique. In this case, inpaint_nans does exactly that. So why are you surprised? The functions that MATLAB provides are used all over the place.
As far as getting an error, I (the fellow who wrote inpaint_nans) have no idea what you have done, since you do not show us the matrix you are passing to it. Perhaps you are trying to use it on some strange array type. (I cannot recreate your error. inpaint_nans has error checks to look for at least a few of the common mistakes I would expect.)
If I had to make a guess, I think you have a function named unique on your search path, since unique does not return that as an error in any way that I can create. So do this:
then see if you have an m-file named unique. If you do, then change the name. DON'T NAME YOUR FILES WITH THE NAMES OF USEFUL TOOLS IN MATLAB! If you do, then expect to get random errors.
Finally, if the above command does not identify a spurious unique function that you have created, then you need to tell more information. What release of MATLAB are you using? Is this a REALLY old release? inpaint_nans was written a LONG time ago, so that should not be a factor.