Data appear in both dependent and independent variable: what is this error called? I want to find a proper name for the analytical problem I've identified below.
One of the most accurate measure of firearm availability is the proportion of suicides committed with firearms, or FS/S (firearm suicides / suicides). The literature is divided on whether this proxy is appropriate when the outcome is suicides: some think it's fine, though others including me think it's bad because the same data appear in both the dependent and independent variables.
I've put together some R code to show that this leads to spurious associations. I simulated firearm and non-firearm suicides using the mean and SD from real Global Burden of Disease Data, then use an ordinary least squares regression to test whether the simulated FS/S is associated with firearm, non-firearm, and total suicides. Even though the firearm and non-firearm suicides were generated independently, the proportion of the total that is firearm suicide (FS/S) has a highly significant association (p < .001) with both firearm and total suicides. These associations are obviously the result of having the same data in both the independent and dependent variable.
I think this could be collider bias, though some call it "contaminations" or a "mechanical" association," but none of these seem quite right to me. Can anyone help?
library(tidyverse)

# generate simulated data, analyse, put into table; source for info: https://msalganik.wordpress.com/2017/01/21/making-sense-of-the-rlnorm-function-in-r/
firearm_mean <- 
  log(0.8 ^ 2 / sqrt(1.4 ^ 2 + 0.8 ^ 2))
firearm_sd <- 
  sqrt(log(1 + (1.4 ^ 2 / 0.8 ^ 2)))

nonfirearm_mean <- 
  log(9.6 ^ 2 / sqrt(6.9 ^ 2 + 9.6 ^ 2))
nonfirearm_sd <- 
  sqrt(log(1 + (6.9 ^ 2 / 9.6 ^ 2)))

sim <- 
  tibble(
    firearm_sim = 
      rlnorm(n = 200, 
             meanlog = firearm_mean, 
             sdlog = firearm_sd), 
    nonfirearm_sim = 
      plnorm(200, meanlog = nonfirearm_mean, 
             sdlog = nonfirearm_sd), 
    total_sim = firearm_sim + nonfirearm_sim, 
    fs_s = (firearm_sim / total_sim) * 100) %>% 
  pivot_longer(cols = contains("sim"), 
               names_to = "method", 
               values_to = "rate") %>% 
  group_by(method) %>% 
  do(lm(log(rate) ~ fs_s, 
        data = .) %>% 
       clean() %>% 
       filter(term != "(Intercept)")) %>% 
  transmute(method = 
              recode(method, 
                     "firearm_sim" = "Firearm suicide", 
                     "nonfirearm_sim" = 
                       "Non-firearm suicide", 
                     "total_sim" = "Total suicide"), 
            est = format(round(estimate, 3), nsmall = 3), 
            p = format(round(p_value, 3), nsmall = 3)) %>% 
  print()



When scrutinising cases like this, it is useful to go back to first principles and see what the model equation looks like once you simplify it down to its most primitive variables.  For illustrative purposes, I will assume we are talking about a linear regression.  The most primitive variables in this case are the counts of suicides using firearms and those not using firearms, so we will examine how these are related under the stipulated model.

For each data point $i$ (representing a particular place/time), suppose we let $F_i$ denote the number of suicides using firearms and $N_i$ denote the number of suicides not using firearms.  The total number of suicides is then $Y_i = F_i+N_i$ and proportion using firearms is $R_i = F_i/(F_i+N_i)$.  If we form a linear regression model with $Y_i$ as the response variable and $R_i$ as an explanatory variable (plus, say, $m$ other explanatory variables) then the model equation is:
$$\begin{align}
Y_i 
&= \beta_0 + \beta_* R_i + \sum_{k=1}^m \beta_k X_{k,i} + \varepsilon_i, \\[6pt]
\end{align}$$
which is equivalent to:
$$\begin{align}
F_i + N_i
&= \beta_0 + \beta_* \frac{F_i}{F_i + N_i} + \sum_{k=1}^m \beta_k X_{k,i} + \varepsilon_i. \\[6pt]
\end{align}$$
Re-arranging this equation gives the following quadratic form (in $N_i$):
$$N_i^2 + (A_i + F_i) N_i + (A_i - \beta_*) F_i = 0
\quad \quad \quad \quad \quad 
A_i \equiv F_i - \beta_0 - \sum_{k=1}^m \beta_k X_{k,i} - \varepsilon_i.$$
The discriminant of this quadratic is:
$$\begin{align}
\Delta 
&= (A_i + F_i)^2 - 4 (A_i - \beta_*) F_i \\[6pt]
&= A_i^2 + 2 A_i F_i + F_i^2 - 4 A_i F_i + 4 \beta_* F_i \\[6pt]
&= A_i^2 - 2 A_i F_i + F_i^2 + 4 \beta_* F_i \\[6pt]
&= (A_i - F_i)^2 + 4 \beta_* F_i, \\[6pt]
\end{align}$$
and the (higher) solution occurs at:
$$\begin{align}
N_i 
&= \frac{1}{2} \Bigg[ (A_i + F_i) + \sqrt{(A_i - F_i)^2 + 4 \beta_* F_i} \Bigg]. \\[6pt]
\end{align}$$
As you can see, this is a pretty horrendous model to use to relate $N_i$ and $F_i$.  It creates a strange relationship between the quantities and it is not a particularly plausible model form.  Since this relationship is implied by the original regression model form, it suggests that the initial model is poorly specified.

In terms of naming this phenomenon, although it is somewhat similar to collider bias, I'm not sure if that's the right term here.  The essential problem here is that even if $F_i$ and $N_i$ are independent, there will (almost always) be some induced statistical association between $Y_i$ and $R_i$ from the deterministic relationships between these quantities.  The problem at issue also depends on the goal of the analysis.  If the goal is to make an inference about the effect of firearm availability on total suicides (through its supposed proxy) then further specification is needed for the assumed relationship that is the basis for the proxy-inference.
