Error code 12 workaround / fix for (TB3->TB2) eGPU on 2015 MBP 15" (might work with other MBPs) !!
If you are using a device other than a 2015 MBP 15", you may need to modify the driver IDs in the script. All this does is repeatedly toggle on and off your eGPU PCIe controller until error 12 is resolved.
Hope that my script helps some of you struggling with resolving this issue!