Whether that is right or wrong, it just is. You can acknowledge that NAFTA is not popular, and that your name is associated with it, and that poor whites believed they were screwed by it, or you can just blame them for being racist. Hillary tends to go for option B.
Clinton pandered like crazy to exactly what you are describing in the 2016 election cycle. I'd offer the exact opposite criticism that this is what makes (some) people think she is an inauthentic politician who will go whichever way the wind blows. I think she should've just stuck by her guns and remained staunchly free trade in the face of the unpopularity of the position. Clinton's worst moment in the debates was when she tried to dance around being free trade rather than just confronting Trump's false claims about it and just trying to say she's going to do the right thing even when it is unpopular. Clinton crushed Trump in the debates and her numbers took a big boost each time they happened, but that moment was emblematic of a weakness of hers.
The real problem I think is that this is was one of the few areas that the media was willing to cover on a policy front because the right is able to get its messages to penetrate what the media is willing to cover so much more effectively. This isn't the fault of the Democrats per se. It's systemic, but it's the Democrats' problem to solve. You can't just ignore reality. You have to try to power through it. There's no reason why free trade or protectionism should be a major focus of the election. Climate change is a much bigger deal and it got essentially no coverage despite the Clinton campaign repeatedly trying to inject it into the conversation. Making Republicans play on Democrat turf is the bigger nut to crack. Clinton's team didn't pull it off.
But also, it is true that Trump's use of xenophobia helps explains why Clinton bled some traditional Democrat voters who score high on measures of racial animus. Clinton pussy-footed around racism in Trump's camp and was generally crushed by the media in the few times she called it out. She had to walk back her intended to be private "deplorable" comments even though they were essentially correct. Her alt-right speech, which in retrospect was right on the money, took a ton of flack and it was backgrounded in the overall campaign.
Perhaps the government could have done something to alleviate that. Instead both parties chose not to.
The Democrats have long advocated for economic transition programs with varying degrees of success at accomplishing their aims. Clinton certainly did. She is fairly liberal.