Since this was like a mob hit, I think the global protection racket you refer to as 'the system' is possibly manifesting conflict in 'the commission'. You see this at every level these days. There is a re-alignment going on, it seems, and not everyone is on board. (Just speculation.)
Perhaps he threatened someone that he'd talk. Perhaps some scapegoat was needed to take some pressure off. Perhaps it just wasn't worth protecting him because of mounting evidence. Or perhaps someone just hated his guts.
If it's possible to have someone 'whacked' in jail with little repercussion (which seems to me a somewhat plausible assumption), I can think of all sorts of reasons why things happened the way they did.
To be clear though I think judges, prosecutors and law enforcement face threats on a regular basis and many of them have the guts to do the right thing. Granted with Epstein case this is a bit more scary then the usual cases. Its connected to such powerful people.