Even if she didn’t have a pass or was the person who didn’t pay last time (the driver was mistaken), they never should have closed the door while a person was in them.
Even if the door had managed to detect she was still in the way, the door closing on her could have injured her. And there’s surely always something that could get stuck in the door without the sensor detecting it. If not a walking stick like this case, then a thin piece of clothing.