Flight NZ289 carrying about 270 passengers left Auckland shortly before midnight on Saturday only to return about 10 am on Sunday (2100 GMT Saturday). It turned around several hours into the flight.
"A technicality meant the particular aircraft operating this service did not have Chinese regulatory authority to land in China," the airline said.
China's foreign ministry did not make any immediate comment when contacted by Reuters. Calls to the civil aviation administration were not answered.
Air New Zealand apologised to passengers and said a special service would fly them to Shanghai at 11 pm on Sunday (1000 GMT).
"We know customers will be deeply disappointed and frustrated by this situation and we are very sorry for the disruption to their travel plans," Air New Zealand said.
Disgruntled passengers voiced their disapproval on social media. One posted a picture on Twitter of the onboard flight map showing the aircraft turning around over Papua New Guinea.
"I've just experienced a new level of China Bad, midway through our flight from Auckland to Shanghai, the pilot informs us that Chinese authorities had not given this plane permission to land, so we needed to turn around. A permitting issue, supposedly," the passenger commented.
The same flight, NZ289, was turned back on a flight to China on August 24 last year, although an airline spokeswoman said that was due to an engineering issue, not a permitting one.
The Air New Zealand plane turned around several hours into the flight.