> Just tried covering the window with black tape, did not make
> any difference

You would need to erase it first, then place several layers of tape over the UV window, then reprogram it with the tape in place. If exposure to light is causing it to act oddly, then there's a good chance EPROM registers have already been corrupted.

I've tried black electrical tape too, and found it normally took several layers to effectively block ambient light.

I wouldn't think A/D configuration would affect RA1 or RE0 with ports F & G being analog, but you never know.

Assuming you have config fuse settings set for Microcontroller mode, RE0 should work fine. RA0/INT looks relatively normal, but
if you can make it work on the OTP version, and not on the EPROM version, even with the UV window covered, I would contact Microchip. There may be some subtle difference causing all your headaches.

I gave up on windowed parts years ago when I had similar problems.