ChatGPT is not good at programming in Nyquist. It makes many errors and frequently hallucinates.
As you correctly identified, Nyquist’s built-in filters have frequency dependent phase shift. This is because they are IIR Butterworth filters, and frequency dependent phase shift is a characteristic of IIR filters.
To avoid the phase shift issue, you would need to write your own linear-phase filter. Designing this kind of filter is fairly complex and really requires some knowledge of DSP, but fortunately there is an example included with Audacity. The Spectral Delete effect uses linear-phase filters.
You could could copy the filter design from the spectral-delete.ny plug-in.