There is a difference between SUPORTING label classes and
actually HAVING label classes.
If you are hitting a layer that supports, but does not have, label classes
then layer.labelClasses will not return any label classes,
let alone an itterable list of label classes.
You should test the result list of layer.labelClasses before attempting to use a member of the list.
As well, you have lblclass.expression = "[type]" unindented,
so even if the layer is skipped (for not supporting label classes)
you attempt to use the variable lblclass that is set inside the if statement,
regardless of if the if has failed (and not set the variable) or not.