My main workstation is a Lenovo Thinkpad with dual 1440p external monitors, and haven't run into issues losing heads, however, I wrote my own auto-detect and screen layout wrapper for xrandr so that it would consistently do what I wanted. Basically, my window manager makes calls like: `xrandr --output DP-2-1 --left-of eDP-1 --auto --primary --output DP-2-2 --left-of DP-2-1 --auto --output eDP-1 --auto` when I connect to my docking station and `xrandr --output eDP-1 --auto --primary --output DP-2-1 --off --output DP-2-2 --off --output HDMI-2 --off --output HDMI-1 --off` when I disconnect. MacOS's screen arrangement consistency was pretty great, though - on par with the consistency of my own script.
I think the improvement of moving from MacOS to Linux for me has been that I don't have to try to figure out how the OS "magic" works to make it do what I want, because there is no magic, it's just scripts I've written myself and I understand them because I wrote them.