NetCDF-CF writing: Segmentation fault and metadata issues with SNAP v9.0.4+

Here’s an example of a tile which goes successfully through the workflow and looks all right when viewed in SNAP: S2A_MSIL1C_20230503T101021_N0509_R022_T34WFS_20230503T135150.SAFE

However, GDAL has an issue with the output netCDF. For example the following two commands never return.

gdalinfo L2_of_S2A_MSIL1C_20230503T101021_N0509_R022_T34WFS_20230503T135150_C2X-Nets.nc
gdal_translate NetCDF:L2_of_S2A_MSIL1C_20230503T101021_N0509_R022_T34WFS_20230503T135150_C2X-Nets.nc:lat lat.vrt