Secondary Screen auto-rotates when disconnecting Primary

If the above does not help, you can also remove the malfunctioning component with:

sudo apt remove iio-sensor-proxy

EDIT:
Just found this while looking through the forum on this issue:

1 Like