For example, we might try using the same fit, on some data where I know the answer.
y = sin(x) + randn(size(x))/100;
Of course, we know the derivative function should look a lot like cos(x). Now I'll use the same fit you used. Since you did two fits, I'll look at the second.
ft = fittype('smoothingspline');
[fitresult, gof] = fit( x, y, ft, 'Normalize', 'on' );
I note that while the curve does sort of fit the data, that the smoothing spline used a very poor choice of default smoothing parameter. The result would be a nasty looking mess if I were to then differentiate that TWICE.
xdiff = linspace(0,2*pi,500);
[~,fitdiff2] = differentiate(fitresult,xdiff);
So total garbage. The point is, differentiating a spline is a dangerous thing. Numerical differentiation is in fact a noise amplification process, an ill-posed problem. TWICE differentiating that same curve is just exponentially worse.
What did you do? You allowed the curve fitting toolbox to choose the smoothing spline fit. And, clearly that was a poor idea. Sadly, they don't give a lot of intuition as to what the smoothing parameter would be, or how to specify something more intelligent than their default.
Sorry about that. Oh, yeah. I did not write their code, nor did I write their documentation. So someone should potentially be sorry.
Differentiating a curve TWICE, where you have no idea how the curve fit was generated is probably a bad idea. When that curve is a spline, you would be asking for trouble. (Note that had I done this using my SLM toolbox, it actually gives a decent curve fit out of the box, and then gives what is at least a not unreasonable second derivative plot.) SLM is avavilable from the file exchange.