Mark is right, this is what was happening.
x = sdpvar(2,2,2)
v = vec(x)
norm(v)
should throw an error, as v is not an sdpvar but an ndsdpvar.
But when I use my own vec function
function x = vec(x)
x = x(:)
end
then, the above code works as I intended. It's not any bug in yalmip of course, just something that I want to do for my case. Now that I think about it, I had never used ndsdpvars as inputs to my vec function before, so that's why I was confused here.