The ham sandwich analogy sounds good till you realize that in the primary, New Yorkers picked a much more progressive candidate over their long running Congressman who was fairly high up in the Dem House heirarchy. He clearly also had a D next to his name.
Voters won't let their representative or Senator get away with whatever they want. But a leader can, and demonstrably has, survived or even thrived after taking seemingly difficult votes. What matters is what you believe and how well you communicate it, in addition to the typical political factors that play into these things.
Thus, Manchin's ties to coal industry do matter. He's not just voting wherever his voters point him, as you claimed.