It is something the elevator cars will be designed for, and just by the nature of the elevator we'll have a lot more orbital infrastructure ready to receive the cars. IIRC, much like airplanes at takeoff and landing, there are some windows where it is impractical to recover from a detached elevator that occurs at precisely the wrong moment, but they are relatively small. (Depending on the precise numbers, it may be possible to build a passenger car that has no such windows, but cargo cars will probably just run the risks since it greatly increases their payload.)
I won't promise NOTHING WILL EVER GO WRONG!!!1!, but there are a lot of engineering options to mitigate disaster.