For the last error, I think that you have to either use shape=None or pass an array with a single element as the testval instead of a scalar.
The first error has to do with your model being ill fit for your problem. You can check to see if there are obvious mistakes using model.check_test_point.
I don’t want to pry into why you chose the model you did, but I find it strange that you are using a Bernoulli random variable as the mixtures’ weight. Why not use the probabilities of on and off directly? I think that you are mixing up the definitions of mixtures using latent indexes with the marginalized representation, which is what Mixture is for. This could be behind your bad initial energy