He didnt almost win.
Because some numbskulls decided to back Santorum when were on the cusp of bouncing Romney after Newt won South Carolina, and ready to take Florida, because the geniuses on our side thought we needed to care more about sweater vests and who was better at reciting bible verses, rather than beating the GOPe when we had them right were we wanted them.
Part of the anti-GOPE broke off and started promoting Rick because they thought that it was a fine time to take a risk with a candidate that was a dull as a rock but said some sentimental stuff.
Now you had two factions that split the right, left a lot of bitterness, and that gave Romney all he needed to waltz into the nomination.
I believe your assessment of what happened in 2012 is correct. I would add that the "numbskulls" were egged-on by push polls pushing Santorum.