I was having this problem too, to the point that sometimes I couldn't even log in, and the MacBook only worked properly as a Windows laptop using Bootcamp! If I was able to log in, then soon afterwards it would panic, fans would spin up and it would restart with all the usual error messages.
After several trips to the genius bar, they replaced both the logic and touch ID boards, and everything is working perfectly.
It wakes from sleep as it should, and I am having no kernel panics whatsoever.
So it appears that replacing the logic board and touch ID boards was the answer, and will probably be the answer for everyone experiencing this, which seems like quite a lot of you.
I do believe there is a hardware issue on a number of these 16" MacBooks, and without telling us truthfully that there was, Apple are secretly replacing these with a new hardware revision, which fixes the problem. Whatever works I say, but a bit of honesty would be good. Happy that mine is working as it should - hooray!