It looks like Mexico must have had more stable government and less Santa Anna. I think a good way for the country to be in a good spot going into the period of US westward expansionism would be for there to be a major civil war in the 1820s-30s. Like an earlier version of the Reform War and condensed into a shorter, more intense struggle.
This needed to happen for the conflict between centralists, the church, and federalists to be resolved. Valentín Gómez Farías could be valuable as a leader for the federalists, who could be defending his presidency against Santa Anna and company's coups. Such a conflict could also produce a generation of highly effective commanders. It also helps if, earlier on in the decade, Vicente Guerrero does not choose to leave the capital to lead the army himself, removing the precedent for appointed interim presidents seizing power in their absence as happened to Guerrero IOTL. Establishing a precedent for a stable presidency would go a long way towards preserving the First Federal Republic and even preventing things like the Siete Leyes from happening.
But even if Santa Anna does attempt his centralist coup, if Coahuila y Tejas remains together and joins with the other states in rebellion to restore the 1824 Constitution, the Tejanos might remain with Mexico if it is successful. Especially so if Tejas, as it gains population, is eventually spun off into its own state. Insurrections among American settlers of the kind that resulted in the miracle of independence IOTL under Santa Anna could be crushed in such a timeline, and filibusters likewise.
No internationally recognized independent Tejas would result in there being little justification in the US and abroad for a war with Mexico, while the civil war resolving in favor of the 1824-ist federalists, preserving stable leadership, enfranchising classes and ethnicities, and curtailing the power of the church could result in a faster pace for the development of Mexican industry. This in turn could result in Mexico obtaining more modern artillery in time for a war with the US, which alongside a more stable general staff and presidency could allow Mexico to inflict serious defeats on the US Army in a hypothetical war.
This war could possibly be over California, possibly a California filibuster republic established by US settlers rather like OTL R.o.Texas during an alt gold rush? This more stable state in the south might be better able to project power, and having established better communication and transportation infrastructure to more remote areas in the previous decade, probably at least prevents a successful invasion of Nuevo Mexico, preventing the US Army from linking with the Californians across the Rockies. The Commanche, however, might ally with the US in order to raid Tejas alongside a US invasion. Winfield Scott might be stalled or driven back into the sea, and Mexico could possibly be in a position to acquire a navy of some significance.
Either way, major defeats and setbacks would rapidly intensify anti-war sentiment in both the north and south, which was a not insignificant force IOTL. This could result in an anti-expansionist party taking the white house from the war hawks and pulling the country out of the war. In this scenario, Mexico could possibly end up with status quo ante bellum, or even be in a position to demand reparation from the US. A defeat like this would deal a lot of damage to expansionism and the Manifest Destiny idea. This map could be a logical result.
Another possible result could be an earlier alt-US Civil War resulting in large areas of the south obtaining independence. This alt-CSA could possibly come into conflict with Mexico, and Mexico would (as OTL, tbh) probably win. This might result in Mexican allies being formed from breakaway CS states, or even slave rebellions. An even better way to speed up the US Civil War would be to have the US go to war with Mexico again, and lose again. The UK could possibly support Mexico as well, and an Anglo-Mexican alliance could be an interesting possibility.
I also really like this Bolivia.