Panel is too wide after a reboot

My machine has several monitors. All are set to 1920x1080 resolution, but HDMI-0 (topmost in xrandr list) supports 2560x1440. DP-5 (last in xrandr list) is set as “primary”, the panel is displayed there.

After an update I started getting this glitch. When X Window starts, only the monitor HDMI-0 switches on, and it is set to highest resolution. All saved windows (e.g. maximized Konsole) are opened there and the panel is drawn. Then monitor settings are applied, other monitors are switched on, resolution changes, windows are resized to fit the monitors, the panel is moved to another monitor without changing its size. In other words, its rightmost 20% end up outside the screen. If I manually change some panel settings (e.g. height), it is resized to fit the screen correctly.

How do I fix this?

KDE and Plasma packages versions: 26.04.3, 6.27.0 or 6.6.6. xorg-server is 21.1.24. Gentoo Linux.

So when it does work it is at the correct resolution? I ask because I recently had a similar issue with a monitor connected over HDMI and discovered the maximum supported resolution over HDMI was much lower than the native resolution of the monitor and wondered whether you may have the same issue.

So when it does work it is at the correct resolution?

Yes, by the time the system becomes responsive, the resolutions are correct.

maximum supported resolution over HDMI was much lower than the native resolution of the monitor and wondered whether you may have the same issue.

No, nothing like that. All monitors can work in all modes.

I did see similar problems in the mid-2010ths. Sometimes replacing monitor cable helped, sometimes it was necessary to update EDID database or specify the modeline manually.