Sentence recommended by Crown, defence came close to bringing administration of justice into disrepute, judge says.