There are huge differences being conflated here...
A) The options available for character creation
B) The options available to a player during play (given an allowed character, what can they have the PC attempt)
C) The setting constraints for a campaign (hatred, disdain, rarity, etc)
D) Player Agency (well, other aspects of it)
Just because a DM restricts A severely doesn't in any way axiomatically mean they're going to restrict B...
And B is often restricted by
And C is the majority of what a setting is supposed to do: Create a viably small range of choices to create a particular feel and create story hooks. Combined with A, it makes the majority of a game setting. If the only choices are to play Humans or Elves, and the setting constraints are that all humans and all elves are slaves of the Githyanki, that's very different from allowing only humans or elves, but the elves own the humans. The two will play out very differently, even tho' the PC options are similar.
And D is a nasty term - because its meaning is widely variable. That said, I've seen Agency denied by DM's/GM's who have allowed anything in print, and allowed any action... by making certain that the plot runs on rails no matter what the characters succeed or fail at. The worst offender I've seen simply had the bigbad resurrected after each time the PC's killed him. So, no matter what the PC's did, Mr. Badguy came back the next week as the boss in a new dungeon. And that campaign always started each dungeon "in media res"... dropped into the first fight. Sure, you could try anything you wanted - but it made no difference in the campaign.
But Player Agency also includes elements of B - options in play - If you can't try X, that's a limitation to your agency...
— Sometimes, that limitation is for social contract and group comfort. EG: no detailed sexual narration, no forcible rape by PCs.
— Sometimes, that limitation is for common-sense. EG: No attempting to pull off cartoon physics to run across a 50' wide chasm
— Sometimes, that limitation is to enforce aspects of your character. EG: Your Int 3 Wis 3 Battlemaster isn't going to be making any successful subterfuge plans in my group...
— Sometimes, that limitation is story driven. EG: No, you can't hide because the Dragon already knows where you are.
— Sometimes, that limitation is rules driven. EG: No, you can't keep concentrating on Conjure Fey and still cast Conjure Elemental.
— And sometimes, that limitation is GM being a jerk... EG: No, you can't run away because there's an earthquake which collapses the tunnel in front of you, so turn around and fight the dragon.
You can't have a meaningful story without constraining agency, either voluntarily or mechanically. Without constraints on agency, it's just storytelling, and even good storytelling has agency constraints.