Your problem sounds very similar to an issue I had with a 2014 13" retina macbook pro with a third party ssd installed (purchased from Other World Computing).
The computer was constantly crashing/rebooting when sleeping, or when waking up from sleep. If it was asleep for only a few minutes (10 - 20 minutes maybe?), it could wake up without crashing.
The solution that worked for me was to disable 'Standby' mode by running the following command in the terminal:
sudo pmset -a standby 0
According to Other World Computing, this modification probably does not significantly affect battery life.
Here is the link to their knowledge-base article on this topic:
https://eshop.macsales.com/Service/Knowledgebase/Article/26/785/NVMe-SSDs-Standby-Mode-Issue
Note: This solution does not disable sleep functionality. Your computer will still sleep as usual. Standby mode is what is disabled. This is a deeper type of sleep mode where the contents of RAM are fully copied to the SSD, and the RAM is powered down. Disabling standby will mean that the battery drains slightly faster while the computer is sleeping, but probably not enough for most people to notice.