Remember in ST:PRO, the USS ProtoStar had a Alien System Virus / Malware that wasn't easily defeat-able and could easily transmit to other StarFleet ships.
We all know how they solved the problem if you watched the show.
What if there was some sort of Malware that wouldn't be easily remove-able or defeat-able unless you took extreme measures like decommissioning the vessel.
Who knows what the Monfette Gambit did to the vessel.
Alien Malware might not just be "Lines of Code", but could be something more intrusive, physical, or difficult to defeat.
We saw what Iconian Malware did to the USS Yamato.
Who knows what other kinds of Alien Malware is out there.
Yet the ship was still intact enough for Shelby to fly around in it for Frontier Day, and intact enough for it to attack Starbase 1 with all the other ships. So whatever was wrong with it didn’t seem to be that big a deal.