Do the rules of algebra apply when you’re working with proportionalities?
For example, let $P$ be pressure, $\rho$ be density, and $m$ be mass. Given that $$P \propto \rho \quad\text{and}\quad \rho \propto m,$$ it would be logical to conclude that $$P \propto \rho \propto m$$ and $$P \propto m.$$
However, if I isolate $\rho$ on one side of the proportionality, I would, logically, get $$Pm \propto \rho,$$ since that is the only way both proportionalities—$P \propto \rho$ and $m \propto \rho$ are expressed. Clearly, this does not seem to follow much algebraic sense. How about if I wrote the proportionalities as equalities? $$P=\alpha\rho=\beta m,$$ where $\alpha$ and $\beta$ are proportionality constants. From here, how would you use algebra to obtain $$Pm=\gamma \rho$$ (whatever $\gamma$ is equal to in terms of $\alpha$ and $\beta$)?
I'm not entirely sure where you are coming from on this, so tell me if I am answering a different question here.
Proportionality is defined as follows. $P\propto \rho$ means $P=c\rho$ for a constant $c$. It must mean that and that is all it ever means. It is literally a shorthand way of writing $P=c\rho$.
Thus, you would not logically get $Pm\propto \rho$. This would imply that $Pm=c\rho$ for some constant $c$, or $P=\frac{c}{m}\rho$, but you already said that $P\propto \rho$. Since $m$ is not a constant (at least, not mathematically, although mass usually stays constant), we have a contradiction.
Going on from that, your last line would also give a contradiction. You write $Pm=\gamma m$, which implies of course that $P=\gamma$, a constant.
Hopefully that helps.