The expression became common in the Royal Dockyards where its use expanded to mean anything that had become broken or unusable whatever the cause. The use of the expression further expanded to mean someone who had changed from being a pleasant person to an unpleasant, grouchy bastard, or someone whose health was beginning to fail.
Yeah, when Sally told him about it, he screamed at her like it was her fault! He never was very nice, but now he's really gone to rat shit.
Malcolm's gone to see his doctor again, he really has gone to rat shit.