I've found, that the layout cache is accessed in parallel in several threads. This is a violation of Swing contract.
This problem was already reported in issue #157888, where it's apparent that the code is called in non-AWT thread. But instead of a proper fix, the problem was just masked.