The judicial system does not create the law. The judicial system only determines who has broken the law or not.
The courts interpret the law in a case by case basis and in doing so often also create law - so called common law or case law, which is distinct from statutory law, which is defined by government.
If the government decides that calling the reputation of Mohammed into question is hate speech, and somebody claims Mohammed was a pedophile because he had sex with a nine year old, the court wouldn't be able to say that's not hate speech.
But the Government is very, very unlikely to do this - statutes tend to be broad in their drafting, so the government could determine that attacking a religion is hate speech, however it is very unlikely there would be a specific section referring to the example you cite within that Bill or Act - it simply isn't how statutory law works.
Hence the role of the courts. Within a framework of the broadly written statute the courts might interpret the statutory law as being that the example you cited was unlawful. If that judgement fulfilled to criteria for common or case law, then via the courts the law would be altered as you suggest, until or unless another case created a new and different precedence or government changed to overarching statute.