Maybe it was some temporary problem. Maybe some problem in connection when programming the PIC or for some reason, PIC wasn't programmed properly. Since it's working now, then, there are no worries as long as it doesn't happen again.
Is it possible for you to try the PIC which causes you problems on another hardware? or with some another programm? I know, you can say your problem is solved, but you can check this if you want to go in deep why that happen..