My guess is that the camera's software removes chromatic aberration for the JPEG file, but the NEF still has chromatic aberration because it's the raw sensor data with minimal processing applied to it.
The problem is not in the format it's in the processing. What software are you using to open the NEFs? Capture NX and View NX from Nikon will remove CA just like the in camera algorithms do. In Lightroom you may need to scroll down in the develop pane and and select automatic lens corrections.