In these types of failures, the power supply, the uncoupling of the power supply and the inputs of the PIC, the PCB itself, with generous GND MASS PLANS not only lines, etc., are very involved.
Try to see if you can solve it by deactivating (if you have it activated) the PWRTE, place a capacitor between the power pins of the 100nF PIC (14 and 5) and you can place a 100nF capacitor between the relay contacts that switches the solenoids series with a resistance of 47Ω x 1W.
The capacitor preferably made of polyester and 630V insulation.
Regards.
Ric.

In the image the network is badly connected because in the schematic it is connected in this way so that the pins on the PCB that I was doing with the relay that I had but goes between the output (NA) and the common one would coincide.