GRIB reader crashes when horizontal reference variable is discarded due to vertical level inconsistencies.
When the GRIB reader performs its consistency checks, the first encountered variable is choosen as the horizontal reference variable. Though if you set a custom vertical reference variable for the dataset, it might be, that the horizontal reference variable is discarded. That causes the GRIB reader to crash, when checking for horizontal consistency.