He is being charged for Sedition which is 8 years in prison. The best thing for him is to escape and i believe even many malaysian muslims will help him to escape as long as he repents for his mistake. People are never cruel only institutions are cruel, because if they are not, they lose control and the consequences are far more than a simple prank.
I really don't think that the OP made any mistakes. And you're wrong about people not being cruel. They can be very cruel. Very recently in my country, four bloggers were jailed because they wrote sarcastic blogs about Islam and one was killed for running a website that mocked religion. And the vast majority of the people were happy. And I'm not talking about the old generation, I'm talking about generation Y and Z.
I myself, received threats because my FaceBook said I was an 'atheist' and I was engaged with social media movement against religious oppression.