That’s because macOS sometimes sees these docks as AirPlay or DisplayLink devices and thinks you want to screen share. It’s not true “extended desktop” in the normal sense. Go to Settings → Displays and make sure it’s set to “extend” not “mirror.”
My M1 did the same with a Belkin dock. Updating DisplayLink Manager finally fixed it