About phase unwrapping
The problem comes from sampling the phase. For the given phase function, the changes in the phase from one value $t_i$ to the next one $t_{i+1}$ can become too large, so phase unwrapping will not work properly. If you simply removed the factor $2\pi$ in the exponent, the problem would be solved already (note that the factor shouldn't be there anyway according to definition of $y(t)$ in your first formula):

s = exp(1i*phi);

If you want to keep the factor $2\pi$, then use more sampling points.