Building and expanding refineries is a challenging task involving many moving parts. But even the best projects can unravel if politics shift, the economy sours, or another “black swan” event hits.