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.
🧲, 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.