How about instead of using the function torch.min to obtain min_loss, compare the value of the loss and keep the min_loss in the loop. Then, at the end call .backward()on min_loss :
min_loss_value= 99.00
for _ in range(n_samples):
    out = net(x)    
    loss = lossfunc(x,y)
    if oss.detach() < min_loss_value:
       min_loss = loss
       min_loss_value = loss.detach()

min_loss.backward()

I think this way, you definitely have only one loss to compute its gradients. But I guess when you use torch.min() the gradients for others in the list may still be computed. So, basically, autograd computes the gradients on torch.max and torch.min.  For example, if we have a tensor with elements [1, 2, 3], then torch.max() will retrieve the max value, but there is a tensor of gradients which [0, 0, 1]. These gradient values are like the effect of each element on the output of torch.max().