I don't think the magical-realism analogy works very well here. There's an abstraction-layer you're missing, I think, of the difference between player-facing options and character-facing options, which isn't replicated in magical realism.
In magical realism—or, at least, all but the most aggressively metafictional magical realism—the thing that's happening isn't "the magic happens only in the narration, not in-universe, while in-universe events are meanwhile fully coherent and consistent-with-ordinary-human-psychology but look very different from what's narrated"; but, in many TTRPGs, that's precisely the thing going on. This varies in how overt it is, but it's in fact all over the place.
For a very overt example of this, see e.g. Gone to Hell, in which players get access to such actions as "attempt a clever solution that just makes the problem worse" and "fail to anticipate the obvious consequences". Clearly, this isn't the player character choosing to do these things; rather, it's the player choosing for the player character to do these things, causing the player character, in-story, to do them unintentionally while attempting to do other things. There's going to be a coherent in-universe account of why the PC attempted their clever solution, and of why it ended up backfiring; that account isn't going to look at all like "they decided to take the action of 'attempt a clever solution that just makes the problem worse'".
For a less overt example, meanwhile, I'd point you in directions like the D&D 3.5 / Pathfinder 1 barbarian's Rage ability, whose initiation is entirely under player control, even as in-universe the thing it represents is typically a much less controlled sort of rage; it would be a decidedly unconventional flavoring for barbarians, for them to be people of very exceptionally strong mental self-control who deliberately choose to enter the enraged mental state for precisely only those moments when their doing so appears tactically-ideal in combat, even as that's precisely what their player is likely to be doing most of the time. And, much like the Gone to Hell case, this is implicitly justified by in-universe causal pathways different from the player-facing ones, with in-universe events happening to push the character into / out of the relevant psychological state with timing concurrent to when the player chooses to enter / exit the relevant game-mechanical state.
The thing rules like the ones in these two examples are doing, then, isn't describing what options the player characters are choosing to take. Rather, what they're doing is offering the players levers of influence over the direction in which the player characters' story goes. Unlike in magical realism, when you look underneath, there's still room for a fully consistent causal story about what happened in-universe, much as a well-told (non-magical-realism) fantasy novel will typically have a causal story about why in-universe goings-on are going on beyond "the author decided to have these things happen".
And then, once you have rules like that, it's easy to see how worldbuilding comes in as a thing that can exist separately from, but coexist with, them: the worldbuilding defines what the in-universe causal pathways are by which the player-selected outcomes end up taking place. The player chooses to have their character fail to anticipate an obvious consequence to an action; the worldbuilding supplies the background-information that cognition-impairing magic exists and could have been cast on the player's character in such a way as to cause that failure-of-anticipation.
(The thing with the iron, I agree, is silly, and I will make no attempt to defend that one. That's a case where multiple systems which are trying to describe principles of how things work in-universe are in conflict with one another around the edges, without any of the involved systems being of the purely-player-facing variety.)