30-40k ft is absolutely a problem. Even if you remain conscious, you're completely unable to think coherently and generally have no idea what you're doing. Stay there long enough and you will unquestionably suffer brain damage and probably death as well.
SmarterEveryDay did a good video about hypoxia training that demonstrates the very rapid onset and severe effects of hypoxia at cruising altitudes: https://www.youtube.com/watch?v=kUfF2MTnqAw
There's a reason why it's called the Death Zone (26k feet). And people that go up there acclimate for days or weeks, often with oxygen tanks anyways. And this plane story is likely going from sea level instantly to 40K.