I am trying to find the fixed point of a dynamical system, which requires solving two coupled eigenvalue-like equations. These equations are, in general, overconstrained. I'd like to have a simple criterion for whether or not there will be a solution.

Assume that there are two given matrices, $A$ and $B$. I want to find a diagonal matrix $X$ and a nonzero vector $y$ such that the following two conditions are satisfied: \begin{align} X A y &= y \\ (A - X B)y &= 2y \end{align} (All matrices are of size $n \times n$, and $y$ is of size $n$.) Please feel free to suggest any reasonable simplifying assumptions if it helps solve the problem.

Here is a hand-wavy argument to suggest that the problem is slightly overconstrained. I have $2n$ free variables, and the two conditions above impose $2n$ constraints, suggesting that there is generally a solution. However, they have the obvious solution $y=0$, which I am excluding, so it's almost as if there are $2n+1$ constraints. Therefore, it seems like solutions to this problem should be possible if one extra condition is satisfied by $A$ and $B$, which would make one of the constraints degenerate. (Yes, this is extremely wishy-washy and possibly wrong.)

I posted a related question here in the hope that it would give me some insight into this problem, but so far I am still stuck. Thanks in advance for any ideas!