My ex got a suspended sentence for harassing me. It wasn't even his first offence as after I kicked him into touch, he went to prison for harassing another woman. She was 'harassed' a couple of times over a few months. I'd been harassed over a decade and when he was found guilty, the judge had said it was one of the worst cases he had ever seen. A month later, he returned, bringing in a suspended sentence.
MH issues yes. But a crime was committed.
The woman who got the conviction was well known and in the media (ex an actor, harassing her for work). I'm a non-entity. Although it was far more threatening and sustained, he walked away scot free. I think judges apply their own perception of not only the victim but the perpetrator. In my case, I was a less famous, therefore less worthy victim. In this case, she was a more posh so more worthy criminal.