Hi,
This is not a ROM problem i think but my phone Redmi Note 5 Pro change screen rotation way to easy. If it is horizontal (flat) on a table it can change between portrait and landscape. It would be nice if there was a setting, a config or an app that stopped the phone from changing screen...