Mathematica doesn’t plot oscillating functions correctly. Weird wiggles and breaks in the plots are so common at least in the new versions of Mathematica. The solution to this problem is, of course, increase the sampling points. One way of doing this is through

PlotPoints->....

For example, suppose the plot range is from 0 to endpoint=1000, I could use

PlotPoints->Length@endpoint