MIDI notes too early

Correct, and it is. The only problem is, you want the sound (what you hear while playing) to be on time so you press your keys 40ms early (compensating).

Cubase places the MIDI data at the moment the key is pressed (e.g. the data is time stamped), how it should be.
Live does exactly the same, the big difference is: Live delays the audio of the whole project, except the played instrument by the amount of latency present. That way your overcompensating is compensated and the MIDI track is on time where it should be.

Try this to see what I mean.
Add a rhythmic MIDI event on one track and shift it X ms (X is your 40ms) forward.
Play an additional part on a second track.
After that, shift the first track back.
If you played like you normally do (with the human compensation) you’ll see the MIDI you played is on time and where you intended it to be.