One of my organization's M-series laptops had that problem. The Logic Board was bad (the TouchID also had to be replaced even though the TouchID was fine because the parts are paired together).....luckily the laptop was still under warranty.
Make sure to disconnect all other external devices from the computer just in case one of them is causing a problem.
About the only thing you can really try is to perform a DFU firmware Revive to reset the security enclave chip & system firmware. I doubt that will help, but that is all you can do except have Apple or an Apple Authorized Service Provider examine the laptop to provide you with a repair estimate.
FYI, make sure you have a good backup since the DFU firmware Revive could cause you to lose access to the data on the internal SSD if the process does not complete successfully. Plus when Apple replaces the Logic Board, all your data will be gone since the SSD is integrated into the Logic Board. I would make sure you have Filevault enabled, or even better.....perform a clean install of macOS so you remove all your third party apps & personal data so you know you data is inaccessible.
People should always have frequent and regular backups of their computer and all external media (including the cloud) which contains important & unique data. There are a lot more new ways to permanently lose access to the data on the internal SSD of these recent Macs due to all the hardware, software, and security changes.