I do not think that diconnecting of battery while motor runs is risk for firmware ... but teoretically also that can happen. The problem are high voltage peaks as Dean wrote. The motor is induction, and when transistors switch current to coil off, the self induction pushes the current further, and it goes via diodes back to the battery as short charging peaks. If battery is not present, the current will make high voltage on transistors and it can damage them. It will lead to burn next time you connect battery. I know minimally one of completaly burned model because of exactly this reason. Unfortunately it was so bad, that damaged was only one transistor, so after connecting of battery everything looked well, but after first throttle up, ESC started to burn, it shorted the battery and pilot could only look how it burns. It was F3A model with 10 cells, but also 4 or 6 cells can do bad thing.
It does not need too much imagination - disconnect battery on field because of something, go home, connected battery to repair the error ... and your hose burns.
So ... never do that. If you need to cut off the e-motor, use either function of timer, if not available, use switch of the ESC wchich will cut the run and also cut the power to timer - both leads to motor stop, if your ESC does not have switch, make switch on power lead to timer (some ESCs has switches only for that connector anyway), it will do the same, and if you do not want it (for example my indoors do not have any switch) then just disconnect timer from ESC connector, it will stop as well.
To prevent problem of voltage peaks, it needs to properly choose large capacitors, which will flat that voltage out, but as I say - it is not trivial task, not for beginners. Additionally capacitors tend to lose capacity during the time, and it is not so easy to chceck them. That is also reason why producers of ESC recommend to use additional low ESR capacitors in middle of long battery leads, and that happens if we install arming plug. So if you use arming plug, and leads are not direct and short, if it needs to add longer lead, it will be good idea to add the capacitor close to the plug.