better error message when grouping by key is not possible due to bad key choice