Drawing of the earliest feathered
dinosaur, Archaeopteryx

The peculiar pose of many fossilized dinosaurs, with wide-open mouth, head thrown back and recurved tail, likely resulted from the agonized death throes typical of brain damage and asphyxiation, according to two paleontologists.

An ostrich-like dinosaur, Struthiomimus; in the classic posture
indicative of brain damage and asphyxiation at death

I found this a very interesting article. I don’t feel I know enough to say how likely it is that this is the explanation for the death positions seen in fossils of these dinosaurs – but I recommend you read it and see what you think.