Broadly, matter shifts to equalize the chemical potential (or molar Gibbs free energy) $\mu_i\equiv\left(\frac{\partial G}{\partial N}\right)_{T,P}$.
It is convenient to define an activity $a$ such that
$$\mu\equiv\mu_0+RT\ln a,$$
where $\mu_0$ is the chemical potential at a reference temperature and pressure (e.g., STP, for which $\mu_0$ values are often tabulated).
The activity of a gas is called the fugacity. It so happens that for an ideal gas, the fugacity is $$a=\frac{P}{P_0},$$ where $P$ is the partial pressure (the total pressure for a pure gas) and $P_0$ is some reference pressure to make the logarithm argument dimensionless (this reference pressure can be arbitrarily set as long as consistency is maintained).
This gives a broader framework for describing equilibrium and kinetics in cases where the temperature varies (or the materials aren't pure, for example). Instead of $P_\text A=P_\text B$ at equilibrium and the flux $q$ scaling to first order with $q\sim P_\text{A}-P_\text B$, we have $\mu_\text A=\mu_\text B$ at equilibrium and the flux scaling to first order with $q\sim\mu_\text A-\mu_\text B=RT\ln\left(\frac{P_\text A}{P_\text B}\right)$. The coefficient mediating this relationship depends on the material properties and geometry of the membrane, the surrounding conditions, and the gas concentrations (e.g., $q=M_\text{AB}c_\text{AB}\nabla\mu_\text{AB}$, where $M$ is a mobility, $c$ is a gas concentration, and $\nabla$ is the spatial gradient, all at the membrane location).
For constant temperature and small differences in pressure $\delta_\text{AB}=\frac{P_\text{A}-P_\text B}{P_\text B}\ll 1$, we have $\ln\left(1+\delta_\text{AB}\right)\approx \delta_\text{AB}$, recovering Fick's law $q\sim P_\text{A}-P_\text B$.
In your example, changing the pressure or temperature in one of the containers while at steady state could cause a new steady-state flow to be established, which can be estimated using the above framework. I'm not seeing a contradiction or paradox in your prediction. If you increase the pressure of an intermediate container, the flow entering from a higher-pressure container will decrease, and the flow exiting to a lower-pressure container will increase.