Confusion about result of FIR All-pass filter design
The dip at Nyquist has to do with the fact that you didn't assign the value $0$ to the desired phase at Nyquist. You correctly assigned $0$ to the phase at DC, but you have to do the same at Nyquist, because a filter with real-valued coefficients has a real-valued frequency response at DC and Nyquist. So you just need 127 random numbers, not 128.

But the plot of the magnitude response of the designed filter is deceptive, because by taking an FFT (of length 256) of the coefficients you basically just plot the desired magnitude (apart from the Nyquist point), because you just invert your design process. Try to zero-pad your coefficients and take an FFT of length 1024 or more. You will be surprised to see that your filter doesn't at all resemble a very good all-pass filter. You see some indication of this in your second plot, which is more realistic.

Note that a non-trivial FIR filter (i.e. one which is not just a single delta impulse) can never have an exactly constant magnitude response, because its transfer function is a polynomial which can't be constant (unless it is a trivial polynomial). Your all-pass filter has an especially poor magnitude response because it is very hard for the filter to approximate those random phase jumps.