This could very well be a hardware or deeper issue. I had a similar but more specific issue with my 2018 mbp, and managed to isolate the issue after quite a bit of trial and error. They replaced it with a 2019 model brand new. I think for me it was specific to letting the battery drain completely, then closing it and plugging it into power and waiting a while. I'd open to a computer that had kernal panicked. It could be related to deep sleep/hibernate, where the contents of ram is written to the ssd and then restored on wake. You can test this probably by setting a hibernate timer and then testing what happens if it sleeps for just under and just over that time.