Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.
I had a similar issue with an incompatible VBIOS. My card was used and I had to find a bios on techpowerup.com that I would work.

You Mac is hanging when it is trying to switch to the OS provided drivers.

This is why I asked if it ever worked in your Mac. My guess would be you have a used RX580 that was flashed for mining and you need to reinstall the stock VBIOS.
 
Well I’ve now got a brick for a router and awaiting replacement, so I can patch my os ready for my new graphics card.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.