whenever you group a feature table, the axis you are grouping on (samples or features) adopt the group labels that you are using. In your case, you are grouping on the sample axis (grouping by sample depth, a column in your original metadata file). So you need to create a new metadata file that has sample IDs consisting of the column you used for grouping.