MacBook Air display turning off when on top of other closed MacBook
That sounds strange, but it's possible that the bottom Mac's closed screen is tricking the top Mac's sensors into thinking that the screen has been shut.

What if you try inserting some "distance" between the two Mac's?  For example, sandwich a thick book in-between the two computers?

In any case, I really cannot imagine there would be any damage to either device.