The quantum circuit model is a model of how quantum systems can evolve in time: how they are prepared, how gates act on the systems, and how they are measured. As such it is really just a model of quantum mechanics where it is assumed you can control quantum systems.
Contextuality is related to properties of quantum theory that arise when one attempts to provide some sort of "more classical" explanation of quantum theory. The Peres-Mermin square you mention shows that one cannot associate the outcomes of commuting measurements of variables as corresponding to some "pre existing" value for every single variable. When one measures terms like $X \otimes X$, in the Peres-Mermin square fo rexample, one cannot associate this with reveal some variable in a deeper theory without knowing what else you are measuring (for example that could be $Y \otimes Y$ and $Z \otimes Z$, or it could be $X \otimes I$ or $I \otimes X$).
Because the quantum circuit model is just a way to talk about a certain set of controllable quantum experiments, there really isn't any conflict with results from contextuality. As you mention, for contextuality experiments, where one performs the measurements that show the conflict, you can always write down a quantum circuit that does this quantum experiment. This applies not just to the measurement based contextuality results, but also the more general results do to Spekkens.
Stepping back, one could however think a bit about the fact that quantum circuits show the flow of quantum data in space time. And then one can ask about how these compare to the potential explanations via classical values that run along these wires. Down this road one begins to see connections to Bell non-locality, and also to results that show that contextuality is a resource for quantum computation. See https://arxiv.org/abs/1610.08529 for an example of this sort of connection.