Unable to use compiler built-in functions to write to dsPIC EEPROM
When in doubt, refactor.

It's not likely a hardware issue, but to rule it out, I would try replacing the C calls with the exact inline assembly instructions described in section 7 of the datasheet, following all of its recommendations (disabling interrupts, polling WR to test for doneness, etc.)

If you get it working, make your own function/library from the inline assembly and carry on.