Sharing referee/AE report online to point out a grievous error in refereeing I submitted a short note to a math journal providing a counterexample to a result in literature that had first appeared in that very journal.

After eight months, I heard from the journal. It was a rejection. The associate editor based his rejection on one referee who had clearly misunderstood my counterexample.

I framed a polite email to the editor-in-chief (EIC) arguing why the referee was wrong in claiming that my counter example was not valid. I don't have high hopes of hearing back from the EIC. He never responded to my emails asking for status updates in months 4, 6 and 8.

For the sake of science (the algorithm to which I propose a counterexample is used by folks in my area of applied math), I intend to upload my paper, the referee report and the covering letter of the associate editor (all of whom are anonymous) on my website and on Research Gate. Alongside this, I plan to upload an explanation explaining why the journal was mathematically wrong to reject my work. I essentially plan to simply upload the letter that I have written to the EIC where I argue why the referee/AE are wrong.

Is there any legal reason why I should not upload the referee/AE reports?

How else can I handle this messy and depressing situation?
For the sake of science [...], I intend to upload my paper, the referee report and the covering letter of the associate editor (all of whom are anonymous, BTW) on my website and on researchgate. Alongside this, I plan to upload an explanation explaining why the journal was mathematically wrong to reject my work.


Besides possibly being a copyright infringement and coming across as immature, this isn't really going to contribute anything to science.  Your paper is not going to attract a significant audience if it's only on your website and researchgate.  arXiv would be slightly better, but not much.

Your contribution to science is the paper itself, so the best way to handle this situation is to revise your paper to make it more clear, particularly to a reader who may have the same misconceptions as the reviewer did.  Then submit it to a different journal.

To be clear, I do not think it is a good idea to post an explicit rebuttal or criticism of the referee's report,  with or without the report itself, on your website or in any other public forum,.   It is unprofessional, and it will cause people to focus less on the content of your work and more on your negative reactions.  You can rebut their concerns indirectly within your paper itself ("it may appear that X, but in fact this is not true because Y"), but do not "call out" the referee or the journal.