I had (emphasis on the past tense) a player that would do this for everything - homebrew campaign and module alike. Whatever the group decided to play or the characters decided to do, he would deliberately try to sabotage it. Not every session, but he would pick the times when it had the most impact. When other players were absent, when we were at the penultimate moment, when his character was the only one interacting with an NPC. It was a deliberate monkey-wrenching and the game got a whole lot after I booted him.
I think it goes back to the social contract. This was a case of one player trying to be disruptive, breaking that social contract. Now, if the whole group says "we want to go do something else," then I think that the DM should always be prepared to rejigger their campaign and seek out what the most amount of people will have fun with.
I had a guy like that at one point as well. No matter what hook I set up, he would ignore it. Have a side-plot that should be right up his alley? He'd reject it. Building on fire and collapsing? He'd run in just to see if I'd kill his PC even though his PC had no reason to do so*.
It didn't make too much of a difference because I run a very sand-boxy game with a lot of improv, but eventually it got to the point where I'd throw things out now and then just to see how hard he'd twist to reject things. Like when he visited his clan (the PC was a dwarf) and they heard that the king was organizing a group to explore some lost ruins. He went to the king and told him he wasn't interested. The confused king pointed out that he hadn't asked for the PC's help.
The player literally laughed while gloating that he had ruined another story arc. He didn't last much longer after that but we should have just parted way then and there.
But back to the OP, I don't run modules for a reason. In my campaign the PCs would wander off and do what they want. Of course the allies of the NPC would be pissed and hunt them down but that's another story. If that meant that their home base burned to the ground because they didn't stop the invasion then it does. Actions or lack of actions have consequences.
But if I were playing a module I would just call a time out and decide what we wanted to do. Agreeing to play a module is a social contract and one I'd expect them to adhere to or at least discuss like adults. If they didn't like the campaign we'd discuss what they did want to do.
*Eventually it worked, I just had a hard time believing a player would have a PC that was so suicidal.
Last edited: