The work energy theorem does not include potential energy because for a change in potential energy only, the net work done on an object equals zero.
For example lift an object a height $h$ beginning at rest and ending at rest. You do positive work transferring energy to the object equal to $mgh$. At the same time since the direction of the gravitational force is opposite the displacement of the object, gravity does an equal amount of negative work $-mgh$, for a net work of zero. Gravity takes the energy you gave the object and stores it as gravitational potential energy of the object-earth system. Since the object starts and ends at rest the change in kinetic energy is zero.
edit: In the libre text article they equate $\Delta KE + \Delta PE =
V\Delta p$ where p is the pressure, how did they get get left side of
equation? that is $W = \Delta KE + \Delta PE$. [ more context]
If only internal conservative forces (e.g., gravity) are involved in a system, the total mechanical energy (KE+PE) is conserved (constant) and we have
$$\Delta PE + \Delta KE = 0$$
If an external force does net external work $W_{ext}$ on the system, then there will be a change in its total mechanical energy
$$\Delta PE + \Delta KE=W_{ext}$$
Rearranging
$$W_{ext}-\Delta PE=\Delta KE$$
Applying the work energy theorem,
$$W_{net}=W_{ext}-\Delta PE=\Delta KE$$
In the case Bernoulli's equation, the external work done on the fluid is the flow work $V\Delta p$ and is due to the difference in pressures at the input and output and is positive if $p_{1}>p_{2}$. The internal work done on the system is the work done by gravity resulting in a change in potential energy. The change in potential energy $\Delta PE$ is negative when $y_{1}>y_{2}$.
Putting it all together we have
$$V(p_{2}-p_{1})-(-mg(y_{2}-y_{1})=W_{net}=\frac{1}{2} mv_{2}^{2} - \frac{1}{2} mv_{1}^{2} \ldotp$$
When applying the work energy principle, the source of the energy for performing $W_{net}$ is irrelevant. It can come from flow work, work done by gravity, or a combination of both. Bernoulli's equation allows for the possibility of both.
The above is consistent with the work-energy theorem which only addresses the effect of the net work done on an object, namely to change its kinetic energy. The source(s) of the energy for performing the net work is irrelevant.
Hope this helps.