Understanding error while sampling a model with conditional probabilities

Please note, that I get the same error if I replace the tt.switch(tt.eq(bs, 0), ns, errs) part with bs * ns + (1 - bs) * errs, the latter which I would have expected to be a totally standard operation.