The problem appears to be that the dependent variable is expected to be a factor. Instead of using a matrix to store the data, I'll use a data frame (df below) which can store multiple variable types (e.g. numerics and factors). I store into df a factor Y, and a numeric X and run the model...
df<-data.frame(Y=factor(c(0,1,1)),X=c(3,1,3))
model<-naiveBayes(Y~X,df)
predict(model,df)
Alternatively, to show that it's the factor that fixed the problem (i.e. not the use of a formula)...
model<-naiveBayes(df[,2],df[,1])
predict(model,df)
Still works.