I'm convinced it's the primary that is breaking the elections here. You have to pander to the kind of people that vote in primaries - more extreme or more available being the key demographics there. So either people with political beliefs way off the party average, or old people.
Until/unless we institute ranked choice voting, the vast majority of people will NEVER have a candidate that reflects their preferences in any meaningful way.
I do wish we'd have a bunch of electoral reforms but those candidates don't do well during primaries.