Source: documentary on the first elevators
Source: documentary on the first elevators
However there is another risk of it flying up and slamming into the ceiling for most types of lifts. For that kind of malfunction there is often no safe guard. A lot of lifts are of the type where they use a large weight which is about half the weight of the maximum load capacity of the lift. This weight is used as a contra weight and hangs in the elevator shaft (so it goes down if the lift goes up). If the brakes in the engine on top of the lift shaft fail there is nothing stopping the contra weight and the lift will fly up.
This is a YouTube video of that happening: https://youtu.be/Ys0rDAxdd-g (warning its not graphic but obviously a disturbing thing to see)
That makes it simply a cost thing. Since most people don't know about this risk and there aren't many accidents there is simply too little incentive.
[0] https://eur-lex.europa.eu/legal-content/EN/TXT/HTML/?uri=CEL... (See Annex I , 3.2)
(In German, there's the word "klemmen" = to tuck, get stuck, get trapped, get caught; presumably it's a cognate. So, the above presumably is a Swedish word for "the risk of getting stuck and squeezed".)