Make sure that both laptops support DP-Alt mode via USB-C or that they have all of the relevant Thunderbolt™ 3 or Thunderbolt™ 4 drivers updated and installed.
If one of the laptops does not support this feature, you will not be able to use the "shared desktop" mode (2 monitors on the main and 1 on the sub). Instead, it will appear that nothing is happening with one press of the mode switch button. Pressing it again will then switch the main laptop to the secondary and vice versa.