Both can be great. If an open world game has a main storyline, it can be useful to implement some measures to avoid free roaming accidentally make the main goal impossible, but as long as RAM size and CPU power don't allow to make open worlds where the players can even destroy any place and building they want, it's often not necessary to temporarily hard limit free roaming, it can be enough to protect in any way key NPCs and unique mission items and/or making hard to reach some places until the PC is really ready, although the most nonlinear games can also provide multiple legit ways to complete the main storyline and its objectives. There are non open world games too, like Deus Ex in some key moments and even more Planescape: Torment, that offer multiple paths.