WI: Ferdinand VII accepted the Crown of Mexico

In 1821, after the Declaration of Independence of the Mexican Empire, the Mexican congress offered Ferdinand VII to become Mexican Emperor, and establish a sort of Commonwealth with Spain and Mexico. But he refused.

What if, Ferdinand VII did accept the Crown of Mexico, and became Emperor of Mexico, establishing a Commonwealth of Mexico? Both countries would be governed by separate laws and form separate legislative bodies, yet have the same head of state.

What could happen with this Mexican Commonwealth/Empire?
Would there still be American Immigration?
Would there be a Texas Revolution?
Would America go to war with Spain and Mexico?
It would require Ferdinand VII to not be an idiot and, in fact, one of the worst Spanish monarchs of all time.

But, if it happened, it at the very least would have prevented the secession of Central America. It could also make Mexico a royalist base used to reconquer parts of South America for the Spanish Crown, maybe even reinforce and prevent the fall of the Viceroyalty of Peru.