This as well as most devices enter programming mode with the "vpp before vdd" sequence. Therefore you cannot simply disconnect vdd. It is surprising that it writes at all.
You should comply with the standard microchip guidance for ICSP, i.e. foresee a way to disconnect vdd from the rest of the circuit during programming.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I'm programming a PIC16F1847 either in the socket or via ICSP.
In the socket on the programmer all works as expected.
Over ICSP I can program the device but reading the PIC wipes the code memory.
I am connecting Vpp, GND, clock/data but not Vdd as the board probably uses more current than the programmer can provide over Vdd.
This as well as most devices enter programming mode with the "vpp before vdd" sequence. Therefore you cannot simply disconnect vdd. It is surprising that it writes at all.
You should comply with the standard microchip guidance for ICSP, i.e. foresee a way to disconnect vdd from the rest of the circuit during programming.
I checked and it does work correctly if you let OP supply Vdd.