Repeated failure after a fixed duration suggests stack problem to me. I can suggest you check the nesting levels in your code and if you have sufficient stack left over for interrupts use. Due to stack failure, the program could be returning to a wrong location and somehow modifying the CVRCON register and turning the AN2 port to output VREF. There may be other symptoms that accompany this.