If they'd done it like 5 years earlier they'd been fighting Mexico for and and probably would have won their Deseret.
Sometimes, I think the Mexican War was a mistake insomuch as the lands NOT of the Texan Republic, but the Mexican Cession, were ultimately more troublesome than they were worth to annex. Not just for the Mormons, but the fact we took in lands that geographically were their own little enclaves (California, Utah Territory in total, New Mexico's Mexican boundaries) and not easy to connect or travel to the core of the USA back east and vice-versa like Texas is or even the Pacific Northwest via the South Pass/Oregon Trail route.
I'd have simply annexed Texas to the Nueces and Pecos Rivers than the Rio Grande, since those are geographically awesome natural boundaries of rivers bordering harsh deserts, we'd lose only a small amount of the formal land we claimed Texas contained since the Louisiana Purchase, and most importantly avoid absorbing the Mexican settlements (and thus, Mexicans) on the Rio Grande and especially splitting New Mexico in half. But otherwise the vast majority of American population would be in a fairly defined area east of the 98th parallel outside eastern Texas, and all of it easy to travel across by water (Intracoastal Waterway/Great Loop, eh) or foot (mostly flat land outside the Appalachians, not too hard to cross overall) alike and said Pac-Northwest still miraculously easy to access from said South Pass.
California would be a loss, of course, but a lot of its initial "investment" of human and literal capital via the 1849 Gold Rush would remain back east for use elsewhere and compound as time goes on. And Deseret would likely look to us as a big brother republic when it won independence, perhaps the same for an eventually independent California (those Californios
hated Mexico proper) that still absorbs a lot of Yankee migrants in some version of a gold rush. New Mexico, who knows if it goes independent or not - they also disliked Mexico Proper but were easily the most settled part of the Mexican Cession, and not too hard to access from Mexico if they keep the Rio Grande itself as I speak of.