The campaign was intended to be difficult. We knew and accepted that up front, and it sounded like a fun challenge. But we never knew until we were already a fair ways into it how much of the difficulty would not be of the "challenge" variety but rather the "railroading" variety, inventing fake difficulty with no basis just to punish the PCs.
For example, at one point the party came across an abandoned wagon. There were a few subtle things in the description that were just "off" enough about it that the first thought that crossed my character's mind was "plague." He treated the entire encounter with excessive paranoia, staying well back, not touching anything, using Mage Hand to move items, etc. Not all of the party members were as cautious, though, moving in freely to help whoever might be inside. And... well... it turned out that there was in fact a serious disease that had claimed the owner. Several party members had to make CON saves against disease because they touched things, including my character.
I pointed out that my character had never actually touched anything, and had only moved things from a distance with Mage Hand, and showed the DM the relevant point in the logs. (It's a game being played online.) The DM, faced with the proof, acknowledged that I was right... but my character still had to do the CON save and ended up contracting the disease, necessitating some long and pointless backtracking to find an NPC who could help get us cured.
And that kind of thing is distressingly common. At one point, when the party came up with a highly unconventional approach to the broad quest we were facing, we decided to put the plan into motion. The very next scene, we ran across a group of Duergar "traders" who were Most Definitely Not Evil Slavers, No Siree. Everyone in the party recognized this for exactly what it was and wanted no part of it, so we did everything within our power to get them to go away and leave us alone: lying about where we were headed and rolling quite well on the deception check, (truthfully) pointing out how we were being hunted by a very powerful and scary dragon that they shouldn't want anything to do with, sneaking off after they left to gather the rest of their group, having the Ranger's flying pet fly overwatch as we fled, etc. But none of that careful, detailed work meant anything; back on the rails you go! The Duergar snuck up on us in the middle of the night, having tracked us perfectly (despite covering our tracks) without ever being seen (despite the eye in the sky) and ambushed our party (despite us setting a watch) to capture everyone.
How do you deal with DMs that completely discount players' agency every time it threatens to make the story diverge from whatever the pre-planned idea is of how the campaign should play out? It kind of feels like, if our ability to foresee certain problems is meaningless because any attempt to avert them is nullified, then what's the point of being able to make choices in the first place? Anyone have any techniques that would help to salvage a game like this?