ESC disconnecting battery while BLDC is rotating protection
Linear regulars have a weakness in that they can latch up if their output is higher than their input. This is of special concern in battery powered devices, especially automotive.

If you are lucky, the output capacitance is relatively low so when the input is disconnected this "latch up" just discharges the output capacitance. Over time this will degrade the regulator.

In this specific instance, you have just removed the power to the ESC, the rotor of the BLDC will still have stored energy (\$E = \frac{1}{2}J\omega^2 \$). Its rotation will produce some terminal voltage (\$V = K_e\omega \$). 

Input power has been removed but there will still be voltage present on the output of the regulator due to local decoupling, but equally possibly due to the fact there is stored inertial energy that is being rectified back onto your ESC local link (ESC circuit specific)

The simplest solution is to include a reverse protection diode across the regulator to ensure the output never rises more than a diode drop than its input.






  SHORTING THE REGULATOR INPUT
  
  When using large capacitors at the output of these regulators, a
  protection diode connected input to output may be required if the
  input is shorted to ground. Without the protection diode, an input
  short will cause the input to rapidly approach ground potential, while
  the output remains near the initial VOUT because of the stored charge
  in the large output capacitor.
  
  The capacitor will then discharge through a large internal input to
  output diode and parasitic transistors. If the energy released by the
  capacitor is large enough, this diode, low current metal and the
  regulator will be destroyed. The fast diode in Figure 21 will shunt
  most of the capacitors discharge current around the regulator.
  Generally no protection diode is required for values of output
  capacitance ≤ 10 μF.


http://www.ti.com/lit/ds/symlink/lm340.pdf