When putting in JSON or GREL into a Discourse post it works best to surround it with backticks ` which will result in it being displayed without any additional formatting being applied. I've edited the original post to add in the backticks and this is now rendering the JSON correctly.
The same issue has led to the GREL in @tfmorris's reply also being mangled by the Discourse software - as this is GREL the quotes should be straigh not smart - so you will need:
parseJson(value)['message']['reference-count']
That works for me with the JSON you've posted
In case of interest I've also started a thread about whether we should change the behaviour of the forum to avoid quotes being converted to smart quotes automatically as it seems to me that this caused more problems than it solved at least in this particular case