The Riot Act of 1714 is a literal Act of Parliament, which laid down how officials were to respond to riots. One of its provisions was that, before deadly force could be used - that is, before the magistrate was allowed to order the troops to open fire - he had to give fair warning that he was going to shoot; and the form of that warning was prescribed by the act itself:
Our sovereign lord the King chargeth and commandeth all persons, being assembled, immediately to disperse themselves, and peaceably to depart to their habitations, or to their lawful business, upon the pains contained in the act made in the first year of King George, for preventing tumults and riotous assemblies. God save the King.
Reading aloud (or perhaps reciting from memory) this ritual phrase is the original meaning of "reading the Riot Act". Once it had been proclaimed the rioters had an hour to disperse; after that, if anyone was killed or hurt when the troops went in, the magistrates and anyone who helped them were explicitly not criminally liable.
In the New Zealand version of the law, the section outlining how to give the warning is explicitly titled "Reading the Riot Act"; presumably the NZ law is later than the original British law, and by then the phrase had worked its way into the language.
If you don't get answers here, you might consider x-posting to /r/etymology, a sub which specializes in word origins