I don't think inflation is the full story at all.
Trump's core voters - the poorly educated rural voters, mainly - have stuck with him.
What has shifted is the Hispanic vote and to a large extent the collar counties of bigger cities going to Democrats. Another element to this is the failure of gerrymandering. The Hispanic vote has been put off trump by the experience of so many law abiding hispanic-looking citizens realising that they are held in exactly the same suspicion as those poor Guatemalans and Nicaraguans trying to cross the border. The sheer cruelty of the immigration enforcement has been a real eye opener for many Hispanics who may have voted for the GOP before. Plus, don't discount how badly JD Vance came off in his war of words with the Pope.
Many thoughtful people besides Hispanics have been disgusted by the frank fascism and cruelty of ICE, and along with the perception of trump backing Russia vs Ukraine, the stupid and disastrous war (illegally undertaken) with Iran, and the unconditional backing of Israel in its Gaza campaign you have a recipe for a major bad taste in the mouth.
It's not just inflation either - it's the broken promises wrt inflation. There are those very foolish people who will back trump no matter what he says or does, but the cumulative effect of seeing billionaires taking over the country and all the rest of what's been going on has taken a big bite out of the GOP vote.
A lot of what could be called moderate Republicans considered Kamala Harris a very weak candidate (she was, imo, and I'd rather chew off my right arm than vote Republican) but they were still motivated enough to vote for trump or local/ state GOP candidates last time. Many of those people have stayed home or switched allegiance this time, as the dog whistle issues didn't land.