I believe the reason you're getting this error is because when you are compressing the string, you're getting a string like x┌♂I-.☺ ♥▌☺íe
. As you can see it has some weird looking characters. One thing you could do is convert that string into base64 encoded format and then save that as message.
$compressedMessage = gzcompress('Test', 9);
$queueRestProxy->createMessage("test", base64_encode($compressedMessage));
I just tried the same and it saved the message properly. One thing you would need to keep in mind is that when you get the message, you have to decode it first before decompressing it.