The Mexicans did not have the
What POD(s) will make the Méxican-American War a stalemate, with México retaining California?
As of 1846, the Mexicans did not have the resources to wage multiple campaigns in theaters as distant as central/eastern Mexico, northeastern Mexico, New Mexico and the Southwest, and California.
As is demonstrated by the US successes in all four of those theaters.
Mexico also did not have a navy, which leaves California wide open to combined operations - which is how the US took it, in concert with the overland expeditions.
To get Mexico to a place where it can sucessfully defend both its heatland (Veracruz to Mexico City) as well as the northeastern, northwestern, and Pacific Coast frontiers requires a vastly stronger Mexico (in terms of economic, political, and military strength), which in turn requires a stable Mexico going back to the Mexican Revolution of 1810 or so, which presumably requires something other than the de facto victory of the Mexican conservatives (most of whom were former Spanish loyalists).
All in all, it is a very tall order.
If the Mexicans (under Santa Ana or otherwise) had staked everything on facing Scott - including, presumably, withdrawing in the face of Taylor's expedition, which is almost self-defeating from an internal Mexican political point of view - they possibly could have stopped Scott's invasion at Puebla or somewhere similar - same strategy as 1862 against the French.
The problem there, of course, is the French came back in 1863-64 and won...
In 1846-48, however, the Mexican tried to defend just about everything, and as a consequence, they lost just about everywhere.
California and New Mexico are pretty much impossible for the Mexico of 1846 to hold; once the US was in Texas, the overland approaches were actually simpler (can't really say easier) from the east as from the south, and American sea power was a capabilty the Mexicans could never match, much less overcome.
Best,