I mean, to be clear, the downgrade is not necessarily because of anything about the UK economy, any more than the downgrade of US treasury bonds had anything to do with the US economy.
US treasury bonds got downgraded because our government demonstrated it was dysfunctional to the point that, while there was zero chance we would not be able to pay, there was some chance we would ACCIDENTALLY not pay our debts. (And I guess a small but notable faction that wanted to deliberately not pay our debts, including Donald Trump.)
I assume the UK's downgrade is, similarly, mostly an attempt to reflect that if the UK will vote to destroy its own economy and fuck up everything then maybe lending them money is a little bit more dangerous than expected just on the principle that the UK is a shambles.