Why would they be the same? You are posing two different problems. It sounds like you have reshaped the vector into a 5x20 array. On two dimensional problems, the function works in both dimensions, looking at the neighbors of a point in all directions to interpolate.
Or, did you break the vector into 5 disjoint vectors, then calling inpaint_nans 5 separate times? Even in this case, the function uses the neighbors of a point in each direction. So if a nan is at or near the break point between those segments then of course there will be a difference.
Perhaps you can give an example where you see a problem, attach the data to a comment, and show how you called it.