In the top-right corner of my circuit, i show all un-used input pins on the schmitt trigger device as connected to 12V.
I am aware of the static nature of CMOS devices, and i am sure that the device is not broken because it is performing as it should (as far as i know)
The problem appears to be with the relay turning off when the schmitt trigger input is connected to +12V.
Under these conditions the PIC resets and i cant work out why becase all the input pins on the PIC appear to be at known good stable levels.