Ok, unfortunately the issue is still not resolved. The race condition is resolved when using the com.atlassian.webresource.api.assembler.RequiredResources.requireContext
that accepts a com.atlassian.webresource.api.assembler.resource.ResourcePhase
as a parameter.
However, this only works on the Issue View. It seems like the Issue Navigator does not pick up on resource requests from issue panel context providers / velocity templates, meaning that the code is never included. This worked in Jira 8 and is now broken in Jira 9.