Display configuration resets after plugging in and out HDMI cable

I’m using a laptop with hybrid Intel integrated graphics + Nvidia discrete graphics.

It is running Fedora 37 KDE wayland.

Whenever I configure my displays, I change the display configuration to set the external monitor to the left of the built-in screen, and I set the built-in screen as primary.

However I need to do this every time I plug the HDMI cable in an out, as the display configuration is forgotten.

How to make the display configuration last and not reset whenever I plug the HDMI cable in and out?