The problem is most often presented as a difference between a linear story game and a sandbox game. However that is a false dichotomy. There are a lot of sandbox games in which player choice is an illusion, or where the player has the choice between irrelevant options like where to go, while the actually relevant events are scripted. On the other side a game that tells a story can actually have branches in the story and provide quite a lot of meaningful choices and decisions.
I recently had a problem with lack of player agency in a D&D game in which I am a player. The adventure is a WotC published one, Out of the Abyss. And because sandbox gaming is so popular, many of the WotC published adventures are presented in sandbox format. You have chapters after chapters describing locations and NPCs, but there is no written storyline. The idea is for the DM and the players to create the story together, but it is clear how that is somewhat illusory: One way or another the players end up going through the various locations presented. From one group to another the details and order of the encounters might change, but at the end of the day different groups playing through the same sandbox adventure will have similar experiences. In this particular case the DM didn’t have a lot of time to prepare, and thus ended up trying to present the encounters on the fly as we played. And somewhere in the process the story got lost, and we were just stumbling through the Underdark, getting hit by one unpleasant encounter after the other, while not knowing what actually our goal was or how to achieve it. So we really were in the situation of the world acting upon us, and us simply reacting. And with things not always going well, and the DM being fond of a gruesome narrative style of dark fantasy, at the end I felt more like a victim than like a hero.
Now the challenge for me is to run the D&D campaigns in which I am the DM in a way that this doesn’t happen. I do want the players to be the agents of the story, it should be them who drive the story forward and make the choices. However although both campaigns are presented as sandboxes, a lot of events that will happen are rather predictable. There are a lot of dungeons with rooms that contain monsters which aren’t likely to be open to negotiation. Open door, kill monster, loot treasure is the most likely sequence of events. It is hard to imagine Dungeons & Dragons without the dungeons that make up half of the name, but dungeons by their very nature aren’t all that much “sandbox”. They might not be linear, but the walls generally limit where adventurers can go. So dungeons are easily perceived as being “on rails”.
On the positive side players tend to enjoy a good dungeon romp more than they enjoy being in the middle of a sandbox without a goal. Too much guidance by a DM can be a problem, but not enough guidance can be a far more serious problem. Even in an old school hex crawl it is better if the players know towards what destination they are heading, and why.