I may off a little in this comment=
Zero did not keep up with competition due to intractability of Japanese mindset.
Basically same reason we were able to read their radio traffic.
The Japanese were incapable of believing that they were not the best and smartest on the block,
Due to the culture- lower ranks would never question higher ranks decisions, therefore even though their crypto people knew that codes get broken they could not question or change said codes. We got to read during most of the war.
Zero suffered the same fate- should have been updated to deal with changing conditions but by the time they were losing they were unable to change as pilots were in short supply and their infrastructure was getting hammered.
That is true.
The Japanese actually created better fighters but they ran out of pilots.