Do you understand that the series you show is not the same as what you wrote in code?
Where did the sin term go in your code? Without it, you get something VERY different.
ARGH. We seem to be chasing a moving problem.
Along at least one edge, you have a problem that the series is poorly convergent, and taking only 10 terms is inadequate. You would need many more terms in the series, when t==0. In fact, as I look, your series, it is divergent when t == 0. Why is that the case? When t == 0, the exponential goes away. So now you have an infinite sum of the terms
And since this sub-series is divergent, you have a problem along that edge.