Notch filters: why is $H(e^{j0}) = H(e^{j\pi})$ required?
In general, there is no such requirement for notch filters that $H(e^{j0})=H(e^{j\pi})$ must be satisfied. You could definitely have a notch filter with $H(e^{j0})\neq H(e^{j\pi})$. Having the same gain at DC and at Nyquist is just a practical definition, and if you have a sufficient number of degrees of freedom (i.e., filter coefficients) you might as well make it a requirement. Ideally you want $|H(e^{j\omega})|=1$ for all frequencies except for the notch frequency $\omega_0$, for which you require $H(e^{j\omega_0})=0$.

As a simple example, take the most primitive notch filter, namely a FIR filter of length $3$. Its frequency response must be

$$H(e^{j\omega})=c\cdot \left(1-2z^{-1}\cos(\omega_0)+z^{-2}\right)\tag{1}$$

where $\omega_0$ is the notch frequency, and $c$ is a scaling constant. All degrees of freedom are taken by the requirement of the notch at $\omega_0$, so you don't get equal gains at DC and at Nyquist. Yet, it is a notch filter.