Hi P.Copper,
I too experienced the same problem while using pickit 3. I sometimes turn-off the devices(including PICkit) and then restart it. But later I came to know that, it was due to the fault in the design which caused wrong voltage levels in the PGD and PGC. This was due to a faulty CAN TxRx IC connected to the same PGD and PGC pin used for flashing. So it caused error in the initialization of connection between the PICkit 3 and the controller. After it was corrected, there was no further error happened while flashing.
So I think you better check the connection with the controller and PICkit 3 and compare with the requirements...