Of course, the failure of Zhuge Liang's Northern Expedition was not only due to Cao Cao's several strategies, on the contrary, Zhuge Liang himself had many problems. The first is that Zhuge Liang is meticulous and hands-on. Although he was really evaluated by later generations as doing his best, his talents and generals did not get a good opportunity for development, which made the military orders unable to be unified and did not have more real power, which led to a sharp decline in the strength of Shu after Zhuge Liang's death.
Also, I think Zhuge Liang is good at running the country, but I don't think he is particularly good at running the army. At that time, Shu's national strength could not be compared with Wei's, and five northern expeditions still failed to make achievements, and Wei also experienced many wars, which seized Shu's weakness. In fact, many Romances of the Three Kingdoms are inconsistent with historical facts, and more is to beautify Zhuge Liang.
Moreover, the population base is so different. At that time, the population of Shu was less than 1 10,000, but when Liu Chan surrendered, there were hundreds of thousands of troops, so it was the largest military force among the three countries. But at that time, the population of Wei was more than 5 million, because Zhuge Liang made many northern expeditions, which weakened the national strength of Shu and destroyed its economy.
Therefore, the failure of the Northern Expedition is also an act of God, and Zhuge Liang alone cannot change it.