It failed on the first visit to the section, 6 seconds into the test, at ImageStyleIT.java:82, before the test does anything. So this is not a wait or a navigation race.
The same document as REST served it a few seconds later:
className: Image.Style.Code.ConfigurationClass, number 0, pageVersion 3.1
className: XWiki.ConfigurableClass, number 0
So the xobject is there. Both requests read that document through the same document cache entry and nothing saves it in between, and the xobject's XClass reference is stored relative and resolved against the document's own reference in BaseCollection#getXClassReference(), so it cannot be keyed against the wrong wiki either. A document returned without its xobjects, which is what XWIKI-24778 describes, is therefore ruled out for this failure.
What is empty is the XClass: Image.Style.Code.ConfigurationClass is read as if it had no properties, so $configurationClass.get('defaultStyle') is null, which leaks the two raw Velocity labels, and XWikiDocument#display returns an empty string, which is the empty <dd>.
One fork is left: whether that empty XClass is a persistent state of the cached document or only affects the request that renders the section. The diagnostic now also dumps /rest/wikis/<wiki>/classes/Image.Style.Code.ConfigurationClass on failure. A class served by REST without its properties means the cached document is poisoned; a class served with them means the breakage is scoped to the rendering request.
This message was sent by Atlassian Jira (v9.3.0#930000-sha1:287aeb6)
If image attachments aren't displayed, see this article.