Congratulations! You are the 10 millionth (and 3) person to have run into this problem. :)
It is precision. A Lagrange polynomial through 21 points will be a 20'th degree polynomial.
So you are raising numbers on the order of 20 to the 20th power. Then you are adding and subtracting them from other numbers that may be on the order of 1. (However you evaluate that polynomial, it will cause these same issues.)
What is the range of numbers that a double can handle? About 16 decimal digits. Expect to see numerical garbage. No surprise, you did.
How do you avoid it? Don't use high order polynomials! (By the way, the reason you were given this example is to see exactly that result. Every first class in numerical methods has such an example in it.)