I think you need to gimp the Americans, and I can't see that happening without a PoD during the Napoleonic Wars. Let's have the Spanish hold on to Louisiana when Napoleon first approaches them about a deal, and double down on keeping it by encouraging immigration from anywhere they could get bar the United States. Louisiana is populated by a combination of French royalists, Black freemen, Spanish and Italian immigrants, and Nahua and Quechua from Mexico and the Andes, slowly at first but gathering momentum as the Spanish feel mightily pressured to secure the colony. The need to cheaply reinforce the frontier with the United States leads to the Spanish getting creative and encouraging the Manilla Galleons to return from Asia with Filipino settlers as well as kick-starting start the coolie trade a few years before OTL with the British primarily headed for the Mississippi but also settling a few in California.
When an equivalent of the Peninsular War starts, the Spanish Royal Family flees to Mexico and attempt to govern the New World empire from Mexico City. One of the supposed war aims of Napoleon was to make good on his interests in Louisiana, so the Spanish make a good showing of preparing a navy in the New World both to defend against Napoleon as well as to reclaim Spain. Settlement in Louisiana continues albeit at a reduced rate. Colonists are primarily sourced from their existing New World colonies in Mexico proper, the Spanish Main and Peru-Bolivia, though a steady stream of Spaniards fleeing Napoleon aboard British ships also make their way to the New World fleeing French excess. Tensions not only with France but the United States over Louisiana have solidified British interests in maintaining Spanish control of Louisiana/New Orleans against American expansion. This perceived European encirclement against the United States drives the United States right into the arms of France. Spain's hasty attempts to reinforce Florida would largely prove in vain though a good rapport with the Seminole and runaway slaves would be established by this time that would prove critical in the near future.
An alt-War of 1812 kicks up slightly ahead of schedule and sees the United States up against both Britain and Spain. The war proves highly unpopular both in New England, which depended on trade with Britain, as well as with the states bordering the Mississippi that depended on good relations with the Spanish and New Orleans for their economic prosperity, primarily Kentucky and Tennessee. The war, needless to say, also goes very poorly for the Americans when faced against the Spanish which had been prepping for an invasion for years, albeit not towards the Americans but towards Napoleon's occupation of Spain. The complete domination of the coastline by the combined Anglo-Spanish fleet utterly cripples the American economy and hampers any ambitions they had on Canada, Florida, and the Mississippi. Initially, the Americans were successful in occupying West Florida, northern East Florida, and the upper Mississippi north of St. Louis. These successes quickly turned sour as the British and Spanish started to make gains and shelled America's ports. DC was captured and burnt, Charleston was occupied, and the split fronts resulted in America coming up short both in New York and in Mississippi and Alabama. The Spanish in particular had adopted a policy of offering to free any defecting slave that would fight against the Americans proved wildly successful in aiding their rampage through the interior of the American Deep South and recapturing of West Florida.
The utter mismanagement of the war led first to boycotts and protests but started to escalate over time into talks of secession as Madison doubled and tripled down on the war. This culminated in first New England, then shortly after the states of Tennesse and Kentucky seceding from the United States and suing for peace with the Spanish. To say Madison didn't take it well would be putting it mildly. His disastrous response to the initial talks of secession in the face of his failures in managing the war emboldened the secessionist factions and triggered a complete loss of confidence in the American system. First the Carolinas and Georgia, then New York sued for peace separately with the Anglo-Spanish. The authority of the central government was in tatters and Madison belatedly sued for peace.
The peace would not only establish the permanent borders of the former English colonies with the Spanish colonies but also settle the border between Britain's remaining North American colonies and Spain's. The treaty went as follows:
* Spanish control of both Floridas was affirmed. Spain's borders for West Florida were set to the old 1795 claim, taking the southern half of OTL Mississippi/Alabama.
* East Florida annexes most of the US state of Georgia, its borders set on the Savannah and Chattahoochee Rivers so as to permanently secure the borders of Florida. Most of the lands making up the newly dubbed 'North Florida' are used to compensate ex-slave defectors to the Spanish cause
* The independence of Tennessee and Kentucky is recognized by all parties and guaranteed by Spain and Britain. Federated together with the northern remnant of Mississippi/Alabama not annexed by the Spanish. Country is split between pro-Union, pro-Spanish, and independence factions
* The independence of New England and New York is recognized by all parties
* Britain and Spain set their border in North America at the 43rd parallel
* Tecumseh's confederacy is recognized and guaranteed by Spain and the United States as all lands east of the Mississippi and north of the Ohio River(Britain was very successful) barring the US state of Ohio
* The border of Louisiana, British North America, and Tecumseh's Confederacy meets at OTL Iowa
With the American front won, Spain was now able to dedicate all resources towards the Iberian theater; New World soldiers would make up the primary forces retaking Madrid from the French. At the conclusion of the Napoleonic Wars the question of the rights of the Spanish colonies really starts to gain traction and leads to a political crisis and clash of opinions not only amongst Spain's subjects but also among the royal family...
At this point, I wanna go to bed. So high-level outline time. The Spanish compromise and guarantee a large degree of autonomy for the colonies, but Spain is still clearly running the show. This inspires serious resentment but the situation is temporarily tenable off the high of the collective W Spain and its colonies won together. Spain gets bogged in a good deal of its OTL political quagmire it faced in the 19th history and suffers from a notable decline in its prestige despite still being considered a great power of Europe, dismissively regarded as a great power via virtue of its colonies carrying the mother country. This is taken poorly by Madrid and attempts to roll back some of the rights given to them post-war. This triggers fury and indignation from the New World colonies. The New World core of Mexico, Louisiana, and Florida that made up the backbone of Spain's war efforts take a page from the Americans and organize a convention as to how to respond to Spain's backsliding.
The end result is a panic in Spain at the idea of mirroring the British experience in the New World and resolving to salvage the situation. Initial overtures promising a return to the old rights are met with laughter at the convention and the Spanish bluster. But this bluster quickly turns into horror when they realize what the state of the Spanish militarily ever since the end of the Napoleonic Wars, minus New World troops of questionable loyalty. Truth was, the Spanish really were crutching on New World manpower and resources. A more ambitious compromise was then proposed after seeing the way the wind was blowing, spearheaded by one of the royals more sympathetic to the New World colonists/nostalgic for Mexico City.
The end result is something more than the Commonwealth or even the EU in some aspects that built on the Count of Arranda's plan for independent New World kingdoms. Louisiana and Florida, while both technically capable of having become their own kingdoms instead chose to petition for unification with New Spain. This was due to American revanchism as the political crisis in the United States appeared to be passing with the reincorporation of New York to the Union after years of negotiation and back and forth. Fearing the possibility of the Republic of the Carolinas of the Federation of Kentucky-Tennessee(no idea what to call them) uniting with a United States once more on the upswing, the two colonies decided to preempt any possibility of attack by turning to the strongest of the monarchies, arguably even more so than Spain proper; New Spain, or Mexico.
So there you have it. Gimped USA that still has enough teeth to encourage a unified Hispanic North America, Mexico that incorporates both Louisiana and Florida, as well as the southern half of the American South via wars of conquest and populated by freemen. Top dog in the New World, starts off with a very robust navy inherited from the Napoleonic Wars and a battle-tested army. Arguably the most powerful kingdom of all the Spanish Crowns at independence and absolutely will be given time and competent governance.