Automatic screen rotation is 90 degrees wrong

Hi, I’ve been having this weird problem since updating to plasma 6.

I have a Lenovo IdeaPad D330-10IGM, basically is a small laptop with a detachable screen.

When the screen is docked, rotation is fine (landscape, in settings is shown as a greyed out 90° counter clockwise, maybe this is relevant), but when I detach the screen, it gets rotated 90 degrees and stays with that offset even when autorotating.

Has anyone experienced this? I don’t know if it’s device specific, that’s why I’m posting here and not filing a bug.

I’m on Plasma 6.0.4, Arch. I’ve also tried Fedora 40 and the issue is still there.

Any help will be appreciated, thank you