If an ESC had a second negative connection (P-) that you connect to the BMS, the ESC could be notified that the BMS has signaled a problem, and be able to gradually cut power while leaving braking functional, then completely turn off once stopped.
Similar to this, when the lights go out, pull over and stop because there is a major battery problem.