Most likely a damaged switch, could be a damaged cable shorting out when door is moved.
Try swapping driver and passenger door switches from driver to passenger side.
If the problem moves to the other side then it’s likley a faulty switch.
If the fault stays the same, the wiring needs to be checked out.