Required Resources in Confluence Gadget

We have a CustomField that requires some of our JS/CSS.
If I use the Filter Result Gadget within Confluence the needed Resources are loaded
Custom Field Velocity Template
`
$webResourceManager.requireResourcesForContext(“xxxxx”)

someContent
`

This doesn’t seem to work if I use the same confluence Macro in Confluence. It seems that the additional Resources are not beeing loaded.
I managed to find a maybe related issue:
https://jira.atlassian.com/browse/JRASERVER-61714

Does anyone have a workaround for this, That don’t require to copy the existing Jira Internal Gadget?