What's going on with Scotland and the new "Hate Speech" laws? 7 years in jail? WTF?

What's going on with Scotland and the new "Hate Speech" laws? 7 years in jail? WTF?
So it seems we are heading towards "Pre-Crime" Scotland has just passed a new law where you can get a 7 year prison sentence for "Hate Speech" Apparently, it's not just Scotland.
Poland it seems is also bringing in a similar law with a 3 year prison sentence.
What is going on?