I’ve often wondered about the thermal performance or running a MacBook with the lid closed. One argument is that the reduced surface area from a closed lid increases temperature. Others argue that not running & rendering the display (and thus GPU) generates less heat. I’m not sure who to believe.
Running lid closed with external display has been officially supported since forever so I wouldn't worry about it too much.
It is supported https://support.apple.com/en-us/102555 but thermal throttling reduces performance https://osxdaily.com/2024/04/03/using-m3-macbook-air-in-clam...