I have the same issue in Win10.
When I turn off my primary DP connected monitor, Windows assumes the monitor has been wiped from existence by Thanos and decides to move ALL windows to the second monitor. This includes the windows taskbar, apparently, which activates the prompt "A toolbar is already hidden on this side of your screen. You can have only one auto-hide toolbar per side.", and nukes auto hide from this plane of reality.
Worth to note is that the primary monitor is connected via DP to a discrete GPU, whereas the secondary monitor is connected via DVI to an integrated GPU in the CPU.
Either way, the way Windows 10/11 handles primary/secondary taskbar and moving them between monitors is clearly broken when it tries to draw several toolbars on the same monitor and removing settings as a result.