Laser shining through two holes in distant rotating discs

Expanding on Dale's answer, by shifting your frame of reference, the relative alignment of the two disks changes, since what is "simultaneous" changes!

If we take disk A as the origin, then the relative-simultaneous (undilated) time of disk B shifts under a frame-velocity shift of $v$ by $\beta \frac{x}{c}$, where $x$ is the (non-contracted) displacement to disk B and the usual Lorentz-transformation definitions of $\beta = v/c, \gamma=1/\sqrt{1-\beta^2}$. Disk B therefore is "now rotated ahead" of what it was before the coordinate transformation by the amount it rotated in a time of $ \beta \frac{x}{c}$.

The time it takes for the beam to traverse from A to B is now reduced by the spatial dilation (by a factor of $1/\gamma$) and by the movement of disk B during the travel time (by a factor of $1/(1+\beta)$); the rotation of Disk B is also slowed by time dilation (by a factor of $1/\gamma$). The pre-transformation rotation time of Disk B when the beam was traversing the distance was $\frac{x}{c}$, while the new time is $\frac{1}{\gamma^2}\frac{1}{1+\beta}\frac{x}{c}=\frac{1-\beta^2}{1+\beta}\frac{x}{c}=(1-\beta)\frac{x}{c}$, which is a reduction of $\beta \frac{x}{c}$ - this exactly cancels out the Relativity of simultaneity shift above!

This cancellation is guaranteed by the conservation under any Lorentz transformations of the spacetime interval between the beam passing through the hole in disk A and the hole in disk B - that is, the beam passing through hole A then hole B always aligns with what happens during the traversal from hole A to hole B, no matter what your inertial frame of reference is.

It's illogical for the detector to be hit or not hit depending on the observer. What am I missing? How to resolve this?

The key to resolving almost all relativity “paradoxes” is the relativity of simultaneity. Conceptually it is the most difficult part of special relativity and so it is the part that gets neglected most often. That is the case here. You accounted for time dilation and length contraction, but forgot to account for relativity of simultaneity.

One other thing is that in any frame where the disks are moving the distance that the light travels is different from the distance between the disks. By the time the light moves the distance D’ the far disk has moved. Nevertheless, the key issue is the relativity of simultaneity