This issue was found by @david-sitsky in a Prolog formulation of an
interesting scheduling task:
https://github.com/mthom/scryer-prolog/discussions/3341
See also the filed issue:
https://github.com/mthom/scryer-prolog/issues/3369
Thank you a lot!
This issue needs more analysis to find out what exactly happened here,
whether other cases like it exist, and whether it can be addressed in
a better way. I would greatly appreciate any help!