For example we have a signal x[]:
x[] = [1, 1, 1, 1, 0, 0, 0, 0]
We get the DFT of x[] (only magnitude):
DFT(x)[] = [4.000, 2.613, 0.000, 1.082, 0.000, 1.082, 0.000, 2.613]
And DCT of x[]:
DCT(x)[] = [4.000, 2.563, 0.000, -0.900, -0.000, 0.601, -0.000, -0.510]
Now, we shift the signal, create new signal y[]:
y[] = [0, 0, 1, 1, 1, 1, 0, 0]
We get the DFT of y[]:
DFT(y)[] = [4.000, 2.613, 0.000, 1.082, 0.000, 1.082, 0.000, 2.613]
And DCT of y[]:
DCT(y)[] = [4.000, 0.000, -2.613, -0.000, 0.000, 0.000, 1.082, 0.000]
You can see that both x[] and y[] have same magnitude in DFT, but very different magnitude in DCT.
So, phase information in DFT allows signals with same frequency content but different phase to have same magnitude in DFT. In contrary with that, because DCT has no phase information, signal's phase information goes to magnitude in DCT. It makes signals with same frequency content but different phase give different magnitude results in DCT.
You may discard phase information of DFT. For example, when plotting spectrogram, mostly you don't need to draw the phase. But, sometimes you need the phase information. For example, when reconstructing signal, given the DFT:
DFT()[] = [4.000, 2.613, 0.000, 1.082, 0.000, 1.082, 0.000, 2.613]
You can't know whether the signal is x[] or y[].