Why does my mac keep showing the message “Your computer restarted because of a problem”? I tried to completely reset factory my MacBook so I cleared all the partitions via internet recovery mode according to Apple support tutorial.

Then I reinstalled macOS and all the download process was successful, but I keep getting this message right after my mac downloading process gets completed and by the time the installation process is about to begin, this shows up.
This is how the partitions are organized:

MacBook Pro 2017
I would appreciate if anyone can help me fix this.
If you get that on a clean install, it’s likely you have hardware or a connected device that has failed and needs to be repaired or replaced.
Here is the official guide on when to look at software and when to get hardware support.

https://support.apple.com/en-us/HT200553

In your case - repair the SSD - not the volume in it called Programmer. And if you erase the drive - erase the SSD - not the volume under it named Programmer or Macintosh HD or whatever - the name doesn’t matter - it’s the placement as an object contained inside the drive that’s the difference.