If you boot into Recovery Drive and run diskutil list, do you see a bunch of extra partitions. I found 20 additional disk all just a few MB in size. I had to unmount each using terminal while I was in Recovery then I was able to erase and make one partiton. Not trusting Disk Utility, I booted into El Capitan and was able to use Disk Utility to partiton the drive successfully.
There is something "off" with Disk Utility in High Sierra. Do you have a bootable copy of El Capitan or Sierra you could use to reformat the drive? Yosemite Disk Utility is too far back to be used successfully.
Yes - I can make a bootable USB with Sierra & have seen some rogue partitions - i'm seeing a '-128' shutdown code that the internet
may indicate hardware issue BUT I can run the rMBP fine in Bootcamp/Safe Mode. If this was really a hardware issue then I would be expecting something to pop up in windows as they are both running on top of the same hardware. I also applied the 2018-001 spectre/meltdown fix which I 'believe' is a firmware update.
Before i do the nuclear option of reformatting (again) i want to see if I can get to the bottom of it as spent a week setting up my work env on windows & don't want to lose the setup.
Why would something fail in OSX but run fine in Bootcamp/Safe Mode?? I'm no expert but this points to software/firmware does it not?
PS - i'm also hit by the dGPU lag issue that is being discuss elseware on this forum.