Does this mean that fitting a best fit to the unwrapped phase and subtracting this from the actual phase in not a valid method to attempt to compress the pulses?
First the expected one goes. You're talking about "removing wavelength dependence of phase". If you did exactly that - zeroed out the phase completely - you would actually get a slightly compressed peak.
What you actually do is that you add a linear function to the phase. This does not compress anything; it is a well-known transformation that is equivalent to shifting the peaks in time domain. Just a textbook property of the Fourier transform.
I was under the impression that turning the wavelength dependence on the phase into a constant ( or as close as possible) within the bounds of the pulses in the spectral range would reduce chirp and thus compress the peak?
If the phase is linear w.r.t. wavelength, your peak is already in the most compressed state possible.
In general, yes, it will. However, you're fitting a linear function, but a linear summand does not change the peak shape. If you need to compress it you need to use nonlinear functions for approximation. Linear ones are of no use for this task.
Then goes the unintended one. You convert the spectrum obtained with fft with fftshift for better display. Thus before using ifft to convert it back you need to apply ifftshift first. As you don't, the spectrum is effectively shifted in frequency domain. This results in your time domain phase being added a linear function of time, so the difference between the adjacent points which used to be near zero is now about pi.
What if the phase within the chirp is linear with wavelength?