Wifi greyed out, can't update software without it or via iTunes
A few days ago my iPhone suddenly turned off and took ages to come back on, flicking between the Apple logo and a black screen, before finally turning back on but I found that the Wifi button on the control panel was greyed out.
I can only use 4G, which means I can't update my phone through Settings > General > Software Update (it says I need Wifi to download the update). I read that I should try doing it through iTunes, which I have now tried many times but each time it fails at the end and cites "Error -54".
Resetting the Network Settings did nothing. I have now taken what was the last suggestion on many of the advice articles, and did a full factory reset before reinstalling iOS from my backup. Would this have reinstalled whatever was wrong with my phone? Because it hasn't made any difference; Wifi is still greyed out.
I'm not sure what caused this; I'm assuming it's a bug that would be corrected by updating to iOS 12.4, but of course I can't do this.
Edit: Now I can't use any apps because they can't install without me being logged in to Apple ID/App Store, which I can't do as I get an error message saying "Verification Failed - There was a problem connecting to the server."
iPhone 7