Hopefully somebody can look at it and see what happened. There are so many things that can go wrong, as mentioned.
Sorry, you mentioned bags of sugar and I read that as baggies (as in baggie feeders) but it sounds like you did dry sugar.
As far as the Apiguard goes, I think that only part of the action of Apiguard is vapor, the rest is spread bee to bee. Even if you didn't close the sbb it should have helped. Unless you had a really huge mite load, I doubt mites would kill the whole cluster, more of a gradual weakening, and then failure, especially if they don't have food nearby. And even then the dead bees maintain cluster, heads in the comb, not fall to the bottom. But then again there are many variables any way you look at it.
We've all been there and it is rough going through it for sure! Discouragement, thoughts of throwing in the towel, wondering what we did wrong....it gets better though!