Yeah, that's more an issue that a lot of modules being, on the whole, linear as hell.
That's true. But if a DM is running a linear module (as many/most of them are), there needs to be an understanding established (at the table) that the players not deliberately run the module of the rails.
Is that artificial and a bit constraining to the players? Sure, but the DM is running the module either because they're new and need some experience or because they just don't have the time to run original material, or both. Allowances must be made on the player side as well.