Cubase freezes when recording midi using the score editor

I use Cubase 8.5 Pro on Windows 10.
My audio interface is the Yamaha Moxf6.
I use its sounds using Cubase’s sequencer.
I use MOXF6’s remote controls but the problem is there also by deactivating them
I use two monitors but the problem is there also when I use just one of them.

When I record Midi using the score view it starts recording,
it seems to work but when I try to end the recording it’s frozen.

In details
I have more than one track.
I want to record one track reading the notes of another.
I open the score editor and start recording.
It seems to work but whe I end recording Cubase it’s frozen. I have to terminate from Task manager of windows

I have created this video to explain better (I hope so)

Referring to the previous video.
I’ve understood that the problem occurs only when I use the sustain pedal with half damper response (from 0 to 127, not just on off)