Default [Help] Unable to switch between landscape and portrait in custom roms

I have a strange bug with every custom rom and kernel.
I can't switch back to portrait if I'm in an app with landscape orientation. It is so bad that I can't even see any incoming call.
The only thing I can do is reboot the phone via pressing power key for a few seconds.
Any help and fix would be appreciated.