First, a simple way to get the right answer: Take the partial derivative of both sides of $$r^2=x^2+y^2,$$and you get $$2r\frac{\partial r}{\partial x}=2x.$$
Second, what's wrong with your argument "If I use $x=r \cosθ$ to find $\frac{\mathrm d r}{\mathrm dx}$, the solution will be $\frac{1}{\cos \theta}$": That would be right if $\theta$ were a constant. But of course $\theta$ depends on $x$; what you actually get is $$1=\frac{\partial r}{\partial x}\cos(\theta)-r\frac{\partial\theta}{\partial x}\sin(\theta).$$
$\newcommand\pd[2]{\frac{\partial #1}{\partial #2}}$
It turns out the OP is confused about why we can treat $y$ as a constant but not $\theta$. The answer to that has to do with what
$\pd rx$ means (and what's implicit in the notation):
Partial Derivatives
If $f$ is a function of several variables an informal definition of $\pd fx$ is "the derivative with respect to $x$, holding the other variables constant".
What that means depends on what the "other variables" are. In the informal sort of context we use in calculus, maybe it would be better if the notation made explicit what variables were the "other variables".
In any case, here we're given $r=r(x,y)$, so the "other variable" implicit in the notation $\pd rx$ is $y$; otoh $\theta$ simply is not one of the "other variables".
One could concoct a function $f$ so that $r=f(x,\theta)$. If $r$ had been defined that way then we would hold $\theta$ constant in calculating $\pd rx$. But that's different; here from the context it's clear we want $\pd rx$ assuming $r=r(x,y)$, not $r(x,\theta)$.