Measuring group delay through a linear phase filter
phi_start = rand(1,num_tones)*pi-pi/2;


The line above illustrates your problem. Phase measurements always need to referenced back to something. An absolute phase measurement without a well defined reference is meaningless.

I believe that the method outlined above that you don't measure the absolute phase but the phase of the output relative to the phase of the input. It probably assumes that you can observe both the input and the output. You can measure at an arbitrary time as long as you measure the input and the output simultaneously .