That could be it. Then again, it was a global trend of incumbents losing ground due to inflation. In the US and Canada it was liberals, in the UK it was the Conservatives, and in India it was right wing authoritarians.
Could Mexico's voters really be so different that inflation didn't matter to them? I doubt it.
AMLO and his party have a rare combination of three ingredients: a bold but comprehensible vision, a track record for acting on that vision, and an active connection with the voters whose cooperation and support are essential to acting on the vision.
You don't find that with incumbent parties in other countries, really. Liberals were saying "everything is fine" when it wasn't (killing credibility with non-liberals while failing to inspire liberals). Conservatives are saying "everything is a disaster" but blaming immigrants and modern culture instead of CEOs and greed. I get that this is a Biden support thread, so we should be celebrating his wins, and when he did positive things, I applauded them, but he never spoke daily with the people. In fact, he even refused to have "big boy" press briefings, and now we know why not (he was probably not physically capable of it). Meanwhile, Trudeau and his party's lack of any vision or willingness to accomplish things utterly failed to improve anyone's material conditions in Canada. That's a recipe for getting blamed for inflation. Conservatives won't make anything better, and the pendulum will swing (hard), but when liberals regain power they won't have learned any lessons from this because too many Beltway consultants making $250k per year are depending on nothing fundamentally changing.