I think this is related to the following reports:
- NetCDF-CF writing: Segmentation fault and metadata issues with SNAP v9.0.4+ - snap / Problem Reports
- Java error “invalid memory access” - snap
There is also a ticket in the issue tracker: [SNAP-3509] Invalid memory access error occurs when writing NetCDF-CF file
In the ticket it said the dev team doesn’t want to fix this.
You can save to a different file format, or you can try to remove the metadata with the subset op.