There was a meta-ticket about "infinite recursions" opened recently (and one related ticket might be duplicate of this)
Sorry for being mostly absent currently - personal reasons.
Yes, it's a duplicate (but extended) of #45963. I have put some code that I wanted to put into improvement.c but I don't know if it will work and even if it will, would it be the best solution.
With a bit of sophisticated fantasy, you can create a ruleset where not only several buildings obsolete each other (that's normal - e.g. small wonders represent mutually excepting specialities of a civilization), but at some point two improvements obsoleting each other may appear together that will turn the requirement calculator cycled (e.g.: wonder A is obsoleted by technology X and wonder B at Player range, so is wonder B by Y and A; Player 1 (knowing Y but not X) built A, Player 2 (knowing X but not Y) built B, then one of them forgets all technologies and conquers another one's wonder city). It would be probably too complicated to catch such situations on ruleset load, we should have a method of tie breaking.