This happens to me occasionally on my iPad Air 2. Usually if I put it to sleep, change the physical orientation to the desired one, and then wake it up it comes up in the desired orientation and behaves normally again (responds to orientation changes). Seems to be a bug that goes back a ways in iOS 11 for me.