I made a new test case, it gives an incomplete answer:
/* SWI-Prolog 9.3.26 */
?- _A = f(X), Y = g(_A).
Y = g(f(X)).
?- _A = f(_A), S = [_A].
S = [_A].
That _A
is a cycle term is missing in the answer.
It could be that the push broke some cycle
printing, unlike what the push advertises.
Maybe related also to this problem:
Top-Level swallows Cyclic Term
https://swi-prolog.discourse.group/t/top-level-swallows-cyclic-term/9103/5
Edit 31.07.2025:
The error is input order dependent:
/* SWI-Prolog 9.3.26 */
?- X = f(_Y), _Y = g(X).
X = f(g(X)).
?- _X = f(Y), Y = g(_X).
Y = g(_X).