vectorf() doesn't make sense for getvelocity since it just returns a temporary pointer which you can't really access afterwards.

try this:

float velocity[3];
NewtonBodyGetVelocity(MH.NewtonChar, velocity);
temp_vec2.x = velocity[0];
temp_vec2.y = velocity[1];
temp_vec2.z = velocity[2];