You can try the following although I doubt any of them will change anything, but it never hurts to try.
1) Clear the NVRAM by using the following Terminal command (It is safe for M-series Macs):
sudo nvram -c
This will prompt you for your admin password. Nothing will appear on the screen as you type your password, so just press the "Return" key to submit the password. You may seen some permission errors most likely related to not being able to clear the Computer Name & such which is normal as long as the command itself did not fail. You need to reboot the computer in order for the system to pull in the default NVRAM settings.
2) Perform a DFU firmware Revive which resets the security enclave chip & system firmware. You may even want to do the DFU firmware Restore which resets the SSD & pushes a clean OS onto the internal SSD. If you don't see the Apple logo on first boot after this procedure (or see the Activate Mac screen after the Revive/Restore process, then most likely the laptop has a hardware issue of some sort. Most likely the built-in Display Assembly since the external display works, but there is always a chance the Logic Board has a fault.
How to revive or restore Mac firmware - Apple Support