One thing about the GM is: they know more about the scenario than the player.
I mean: the player might know more about the equipment they're carrying, but the GM could just ask. The player can't ask "What's behind the next door?"
So anyway, when the player thinks up something and goes "Ok, I'm gonna tie a string to the sword and whip it around my head, and decapitate everyone" or something else clever and the GM says "No" the GM is saying many things with that "No" but one is:
I know this scenario, I know where the treasure is and I know where the monsters are and I know: even if I deny you this, there are still many ways to beat the situation. I am challenging you to think of another one.
It is like in one of those riddles where you can ask yes or no questions. Each 'No' is saying "You thought of something but it won't work" but it's also saying "Try harder. Think more".
'No' is a disastrous thing to say if your game is about a power fantasy, but it's the engine of solution-driven adventures, and games based on the fun of challenging the players to think.
And if the GM says 'no' to too many things, or the GM never has any yesses except the ones s/he expects, then that GM is a bad GM and you get rid of them. Stop electing them to that job.