I wonder if it's detecting a magnet at the front edge from the closed lid of the notebook underneath, telling the system on top that the lid is closed?
The sensor that recognizes if the laptop is closed sits on the left, next to the audio jack. If you get a magnet within 2-3 cm of it, it triggers and the screen turns off. Seems like the magnet in the lid of the other laptop is just close enough.
Seems to me that it is likely due to the magnets on the hinge of the bottom laptop connecting with the bottom part of the top laptop. The top laptop then treats it as if the lid is closed.
🧲, my Samsung tablet does the same thing when flipping the magnetic lid around the back. The screen shuts off and it's annoying and it's the official cover.