Residues of $\frac{1}{\prod_{i=1}^n (x-P_i)^{e_i}}$

If we restrict to the case when $e_1=e_2=\cdots=e_n=2$ the right condition is $\sum_{i=1}^n e_i=n+kp$ or $n+kp+1$ for some $k\geq 1$. This provides counterexamples to the stated conjecture (see below) and it shows that the right condition is more complicated than just one inequality.

Here is a proof of my claim: The residue in this case has a simple formula $$\operatorname{Res}_{P_i}\left(\frac{1}{\prod_{i=1}^n(x-P_i)^2}\right)=\frac{2}{\prod_{j\neq i}(P_i-P_j)^2}\left(\sum_{j\neq i}\frac{1}{P_j-P_i}\right)$$ from which we conclude that $$\operatorname{Res}_{P_i}=0 \iff \sum_{j\neq i}\frac{1}{P_j-P_i}=0.$$ Using the fact that $$\frac{d^2}{dx^2}\left(\prod_{i=1}^n (x-P_i)\right)=\frac{1}{2}\sum_{i=1}^n\left(\prod_{j\neq i}(x-P_j)\sum_{j\neq i}\frac{1}{x-P_j}\right)$$ we notice that $\sum_{j\neq k}\frac{1}{P_j-P_k}=0$ is equivalent to the second derivative of $\prod_{i=1}^n(x-P_i)$ vanishing at $P_k$. Since the degree of the second derivative is $n-2$, the only way it can vanish at $n$ distinct points is if it is equal to $0$. So we have proven that $$\operatorname{Res}_{P_i}=0 \quad \text{for all i}\iff \frac{d^2}{dx^2}\left(\prod_{i=1}^n (x-P_i)\right)=0$$ By looking at the leading coefficient we see that the degree can only be $0$ or $1\pmod{p}$. Or, in other words, $\sum_{i=1}^n (e_i-1)\in \{p,p+1,2p,2p+1,\dots\}$. To show that each of these degrees work you can take $P_i$'s to be the roots of polynomials $x^{kp}-x-1$ and $x^{kp+1}-1$, respectively (both polynomials have distinct roots, and their second derivatives vanish).

For an explicit counter example to your conjecture look at $p=5, n=7$ with all $e_i=2$. We have $\sum e_i=14\neq 1\pmod 5$. Yet there exists no choice of distinct $P_i$ for which $\operatorname{Res}_{P_i}=0$ for all $i$.


Easy part: the proof that $\sum e_i\geqslant n+p$.

Assume that $\sum e_i<n+p$. The rational antiderivative should have the form $g/f$, where $f=\prod (x-P_i)^{e_i-1}$, $\deg g<\deg f=\sum (e_i-1)<p$. This may be seen from expanding $\prod (x-P_i)^{-e_i}$ as a sum of elementary fractions and integrating them all. We have $(g/f)'=(g'f-f'g)/f^2$, and if $\deg f=a$, $\deg g=b$, the degree of the numerator equals $a+b-1$, since the leading coefficients of $f'g$, $g'f$ do not cancel (here we use that $p$ can not divide $a-b$). Thus $1=\prod (x-P_i)^{e_i} (g/f)'$ has degree $(n+a)+(a+b-1)-2a=n+b-1>0$, a contradiction.