IPhone doesn't rotate to landscape mode in messaging app?

I have the iPhone 5 running on iOS 6.0.2 and it doesn't rotate to landscape when I'm messaging. This is only sometimes and when I turn it off and on again it works.

The internal gyroscope is stuck, shut off the phone and smack the back of the phone down onto the palm of your hand. Turn the phone back on and should rotate to landscape.