If job Y needs job X (because of a needs clause), and job Y runs, then gitlab-ci has all the information required to force job X to run.
But it doesn’t force X to run.
Instead, we need to work around your bug by larding up X with only clauses to force X to run, anytime Y might run.
The proper fix is for GitLab to force X to run when Y runs, and Y needs X.