"All or nothing" loss function? multilabel classification

Set up
You have an input dataset X, and each row has multiple labels. Eg, 3 possible labels, [1,0,1] etc

The typical approach is to use BCEwithlogits loss or multi label soft margin loss. But what if the problem is now switched to All the labels must be correct, or dont predict anything at all?

What loss function do we pick for this? I thought of coding a custom loss function that returns 0 if all the labels match, else 1 but it seems “hacky”.