Let’s see if we can diagnose this down a bit further. With the external display as well as keyboard and mouse connected, restart your system as soon as you do close the display lid, that will fire off Clam Shell mode. Your system should now be working via the external display. Is this correct? If so the Hall sensor cable or the sensor it’s self has failed. Often times I encounter liquid damage around the sensor.
Review Step 13 in this [guide|128106]