I'm not majorly disagreeing with the overall thrust of your argument... I, too, think Hillary Clinton was an extremely flawed candidate. Personally: the lack of charisma, the inability to project warmth to larger crowds and in the media; the defensiveness and mistrustfulness. Some of that was well understandable, some of it unfair, but there you go. Ideologically: though she actually didn't demonstrate much of her past neoliberal and interventionist inclinations during this campaign, the image still stuck with her to some extent. In terms of how what she stood for (continuity, experience, mainstream moderate/liberal values) clashed with the mood of the time: after two terms, the default tendency of voters is to switch parties, and the thirst for change that erupted after the 2009 crisis never really went away. And, well, being a woman, when there is still an awful lot of sexism around. (It should be noted, though, that in terms of her campaign's discipline and structure, she improved immensely on 2008, when her campaign was just one unending drama of infighting, falling out, leaks, clashes and rapid switches in messaging.)
I do think Bernie had his own major flaws, however -- or to be more precise, things that would be seen by the US electorate as major flaws (I'm fine with them, personally). I never got on board with his campaign, even though he's the one I liked and agreed with more, for that reason: I didn't think he would do better. I saw those flaws across several dimensions too. Ideologically (the socialist thing, and the historically limited appeal in the US of old-school social-democratic rhetoric). Personally (the crotchety but principled old guy thing may have played perfectly with 43-Year-Old White Men yearning for authenticity, but would have played a lot worse with main street suburbia). In terms of experience: as was said endlessly, Bernie had great ratings but also had never faced a concerted attack from the Republican machine when Clinton had faced off with it for two decades. His campaign worked in the context of the primary, but was a lot more haphazard, less professional, less disciplined.
Looking back, I'm still not sure if Bernie would have done better. I think he would have done better in parts of the US and with parts of the electorate, for sure, for some of the reasons you mention. But I think he would probably have lost out in other parts and with other constituencies. People of colour, non-43-Year-Old White Man women, white-collar / suburban / upper middle class voters, #NeverTrump Republicans ... you know the list. Though I do acknowledge that many of those latter groups didn't come out as strongly for Clinton as I (and the Clinton folks, apparently) expected.
Speaking purely in demographic terms, I still think it might have been a wash, at least in total vote count. What does in hindsight make Sanders look better is the electoral college. In line with her "future Obama coalition" strategy, Clinton made gains in Arizona, Georgia and Texas - though not in the more crucial Florida and North Carolina. Meanwhile, that future Obama coalition is not what's going on in exactly those key swing Rust Belt states that ended up delivering the election to Trump. So in those (narrow) demographic-strategic terms, Clinton fought tomorrow's election and lost today's.
But all of that leaves a lot of questions unanswered. The obvious ones: how well would Bernie have weathered all the attacks that piece above previews? How well would an insurgent Bernie campaign, and Bernie himself, have weathered the insane burden of the high-octane presidential campaign? The latter, I don't know. Clinton seemed a steelier, more professional, more disciplined choice, more ready to fight back (dirty if needed) and to not let all the BS get to her and lead her off track. Then again, Trump was anything but professional and disciplined, and was led off track by his personal resentments and annoyances all the time, and he still won. So who knows.
Going back to more demographical concerns: Bernie promised a break from the status quo too, obviously - more so in my mind than Trump, the billionaire who promised to lower wealthy people's taxes most of all. But would Midwestern voters have seen it that way as well? It'd have been pretty damn hard to out-rabble rouse Trump. Faced with two
nominees railing against the establishment, who's to say how many of those angry anti-establishment voters would really have gone with the old-school socialist over the national-populist? Trump's rhetoric and electoral appeal are very similar to those of nationalist-populist, far-right parties here in Europe, and attempts by leftist parties to steal their thunder (or rather, take it back) with an equal dose of populism haven't been greatly successful. I mean, I applaud them, and I still think they are our only hope to keep the working class from falling to the far-right once and for all, but they have a decidedly mixed track record.
Vice versa, there is still a substantial minority of Americans who are not angry, and who are actually quite turned off by Trump's anti-establishment rhetoric. How many of those turned out for Clinton, but would have rolled their eyes at two old angry men yelling populist slogans at each other?
I don't know. Of course part of me regrets that it wasn't Bernie. I don't think, in the end, a candidate like Bernie can win in America - but maybe it was exactly Trump's nomination that would have given him a chance. And now you missed it (because of people like me!). Then again, who would have thought in, say, September 2015, that Trump was going to win?