Try to program it in-circuit without the crystal connected.

Try turning off the EPIC verify option. Then see if your code runs as expected.

Does either work?