Ancient ecosystem’s vulnerability to catastrophe contributed to dinosaur extinction