Collection: Nesting level too deep - recursive dependency?

We found this error multiple times in our server logs:

PHP Fatal error: Nesting level too deep - recursive dependency? in /www/kirby/src/Toolkit/Collection.php on line 922

The mentioned line is sorting the collection, see https://github.com/getkirby/kirby/blob/develop/src/Toolkit/Collection.php#L922.

What’s a possible source of this issue?

I think a similar error has come up several times in different contexts and I’m pretty sure I’ve seen it recently but can’t find it at the moment.

Thanks for your quick reply. Sadly I don’t have any more context for this error message. Does it still make sense to open an issue on Github?

This was the issue I was thinking of: Change status/Delete page: Error = Nesting level too deep - recursive dependency?

But that happened in the Panel and it seems to appear in different contexts, I’ve actually seen this error message myself recently, so it seems to have different causes.

It might be worthwhile to create an issue on GitHub.

Here is the Github issue: