On appeal a lawyer could bring up that Trump’s rhetoric inflamed the Judge who then went overboard and gave the maximum sentence. Had it not been for the inflammatory comments the client might have received a lesser sentence.
His comments now become part of the case..and next time...you might not want the person to get out of their sentence.
Judges are supposed to be immune to the influence of even inflammatory comments by a President. If not, the judge should recuse herself from the case — or be removed by the Court of Appeals. In any event, as President, Trump is the federal government’s chief executive and may criticize subordinate officials and give them direction as he thinks best. There is no law against a President doing what Trump said and did.