I have a 13" 2017 MacBook pro that shuts down randomly. Checking the logs I only see
2023-01-25 18:21:20.028735+0200 0x2ce Default 0x0 0 0 kernel: (AppleSMC) Previous shutdown cause: 5
I checked for previous questions about this problem and found that shutdown cause 5 is a normal shutdown initiated by the user. I also tried rebooting into safe mode. The issue prevails in safe mode as well.