It looks like you’re example is working fine. I think you might be misunderstanding how the applyMatrix() function works. In effect, you’re calling translate(width/2, height/2).
Once it’s called, any drawing functions, like
ellipse(), or in your case,
line(), has the matrix applied to it.
// translating origin to the sketch center
// This should actually draw a line from center to mouse, but it doesn't
// as showed by the black line
line() only knows this: take 4 numbers, apply the matrix to them, draw the line.
mouseY are any other numbers.