This article relates to GRIB edition 2

There are GRIB messages whose packingType is "grid_complex_spatial_differencing" where the missing values are not in a bitmap but stored in the Data Section (as coded values).
In these cases conversion to simple packing can fail.

A workaround is to set the key "bitmapPresent" to 1 before the conversion. This ensures a bitmap is created for the output GRIB and the missing values correctly stored:

% grib_set -r -s bitmapPresent=1,packingType=grid_simple in.grib out.grib

After the conversion, check the statistics of the input and output files to ensure correctness:

% grib_ls -n statistics in.grib out.grib

This will still work even if the input did not have any missing values.