silver lining and all that i guess.
also to add, i also wouldn't trust whatever PSU you are currently using.
what i would do:
1) instead of RMA-ing the new 5800x to AMD, I would raise a ticket to Amazon and get the CPU refunded
2) replace PSU
3) get your ram checked in another system
4) your current CPU and mobo is done for, if you have the spare cash, then there's no point replacing them for a like-for-like on the AM4 platform especially if the ram is toast too - i would hop onto a new AM5 build instead (of course, finances dictating, it may well be that you may have to get another AM4 build if the finances are tight)