You've drawn the wrong lesson. The issue is that you logged one thing and did another, then got confused when the two didn't match. Now you've rewritten it and were lucky enough to rewrite it correctly. But it wasn't the interpolation technique that you wrote it in which made the difference, it is that you didn't make a mistake this time.